public void AliasBookingSmokeTest() { //• Record C - An alias record - make sure the real name record does not have an open booking. Toolbar toolbar = new Toolbar(Toolbar.getPath()); toolbar.WaitUntilLoads(); toolbar.OpenNames(); NamesTable namesTable = new NamesTable(NamesTable.getPath()); namesTable.AddInmate(inmateRecordB, "10101987", "M", out inmateTempRecord); namesTable.Close(); toolbar.OpenNames(); namesTable = new NamesTable(NamesTable.getPath()); namesTable.AddInmate(inmateRecordC, "10101987", "M", inmateTempRecord); namesTable.Close(); toolbar.StartBooking(); NameQuickSearch inmateNameQuickSearch = new NameQuickSearch(NameQuickSearch.getPath()); inmateNameQuickSearch.LastNameQuickSearchTextBox.TextValue = inmateRecordC; inmateNameQuickSearch.SearchButton.Click(); inmateNameQuickSearch.FindCell(inmateRecordC).Click(); inmateNameQuickSearch.SelectNameButton.Click(); }
public void OpenedBookingSmokeTest() { //• Record E - A name record with an open booking Toolbar toolbar = new Toolbar(Toolbar.getPath()); toolbar.WaitUntilLoads(); toolbar.OpenNames(); NamesTable namesTable = new NamesTable(NamesTable.getPath()); namesTable.AddInmate(inmateRecordE, "10101987", "M"); namesTable.Close(); toolbar.StartBooking(); NameQuickSearch inmateNameQuickSearch = new NameQuickSearch(NameQuickSearch.getPath()); inmateNameQuickSearch.LastNameQuickSearchTextBox.TextValue = inmateRecordE; inmateNameQuickSearch.SearchButton.Click(); inmateNameQuickSearch.FindCell(inmateRecordE).Click(); inmateNameQuickSearch.SelectNameButton.Click(); StartBooking startBooking = new StartBooking(StartBooking.getPath()); startBooking.StartNewButton.Click(); startBooking.LocationTextBox.PressKeys("Block A Cell FP1-1"); startBooking.LocationTextBox.PressKeys("{enter}"); startBooking.ProceedButton.Click(); Validate.Exists(BookingChecklist.getPath(), _searchTime); BookingChecklist bookingChecklist = new BookingChecklist(BookingChecklist.getPath()); Assert.AreEqual(bookingChecklist.LastNameText.TextValue, inmateRecordE); toolbar.StartBooking(); inmateNameQuickSearch = new NameQuickSearch(NameQuickSearch.getPath()); inmateNameQuickSearch.LastNameQuickSearchTextBox.TextValue = inmateRecordE; inmateNameQuickSearch.SearchButton.Click(); inmateNameQuickSearch.FindCell(inmateRecordE).Click(); inmateNameQuickSearch.SelectNameButton.Click(); //VALIDATE: SpillmanMessageBox msgBox = new SpillmanMessageBox(SpillmanMessageBox.getPath()); Assert.IsTrue(msgBox.Visible); msgBox.ViewButton.Click(); //VALIDATE:The Booking screen opens to the booking record for Record E. Validate.Exists(Booking.getPath(), _searchTime); Booking booking = new Booking(Booking.getPath()); booking.LastNameText.Click(); Assert.That(booking.LastNameText.Visible); Assert.That(booking.LastNameText.Enabled); Assert.AreEqual(booking.LastNameText.TextValue, inmateRecordE); }
public DataTable ProcessPipelineData(DataTable toProcess, IDataLoadEventListener listener, GracefulCancellationToken cancellationToken) { if (_commonNames == null) { //discover the table var tableDiscovered = NamesTable.Discover(DataAccessContext.DataLoad); //make sure it exists if (!tableDiscovered.Exists()) { throw new NotSupportedException("TableInfo '" + tableDiscovered + "' does not exist!"); } //Download all the data var dataTable = tableDiscovered.GetDataTable(); //Make sure it has the correct expected schema (i.e. 1 column) if (dataTable.Columns.Count != 1) { throw new NotSupportedException("Expected a single column in DataTable '" + tableDiscovered + "'"); } //turn it into an array (throwing out any nulls) _commonNames = dataTable.Rows.Cast <DataRow>().Select(r => r[0] as string).Where(s => !string.IsNullOrWhiteSpace(s)).ToArray(); } //Go through each row in the table foreach (DataRow row in toProcess.Rows) { //for each cell in current row foreach (DataColumn col in toProcess.Columns) { //if it's not a column we are skipping if (ColumnsNotToEvaluate != null && ColumnsNotToEvaluate.IsMatch(col.ColumnName)) { continue; } //if it is a string var stringValue = row[col] as string; if (stringValue != null) { //replace any common names with REDACTED foreach (var name in _commonNames) { stringValue = Regex.Replace(stringValue, name, "REDACTED", RegexOptions.IgnoreCase); } row[col] = stringValue; } } } return(toProcess); }
public void NoNameBookingSmokeTest() { //• Record B - A name record where the DOB places the individual under the Module.Jail.adultAge setting (18) Toolbar toolbar = new Toolbar(Toolbar.getPath()); toolbar.WaitUntilLoads(); toolbar.OpenNames(); NamesTable namesTable = new NamesTable(NamesTable.getPath()); namesTable.AddInmate(inmateRecordA); namesTable.Close(); //Test Step: Start a no-name booking. toolbar.NoNameBooking(); NoNameBooking startBooking = new NoNameBooking(NoNameBooking.getPath()); startBooking.LocationTextBox.Click(); startBooking.LocationTextBox.PressKeys("Block A Cell FJP1-1"); startBooking.LocationTextBox.PressKeys("{enter}"); startBooking.ProceedButton.Click(); Validate.Exists(BookingChecklist.getPath(), _searchTime); BookingChecklist bookingChecklist = new BookingChecklist(BookingChecklist.getPath()); bookingChecklist.InmateRecordLink.Click(); Inmate inmate = new Inmate(Inmate.getPath()); inmate.IdentifyButton.Click(); NameQuickSearch inmateNameQuickSearch = new NameQuickSearch(NameQuickSearch.getPath()); inmateNameQuickSearch.LastNameQuickSearchTextBox.TextValue = inmateRecordA; inmateNameQuickSearch.SearchButton.Click(); inmateNameQuickSearch.FindCell(inmateRecordA).Click(); inmateNameQuickSearch.SelectNameButton.Click(); bookingChecklist.Activate(); //VALIDATE:The Juvenile Instructions dialog opens and shows the text you added in setup. Assert.AreEqual(bookingChecklist.LastNameText.TextValue, inmateRecordA); bookingChecklist.Close(); inmate.Close(); }
public void BookingWithoutGenderSmokeTest() { //• Record A - A new name record.Make sure DOB and Gender are not set. Toolbar toolbar = new Toolbar(Toolbar.getPath()); toolbar.WaitUntilLoads(); toolbar.OpenNames(); NamesTable namesTable = new NamesTable(NamesTable.getPath()); namesTable.AddInmate(inmateRecordA); namesTable.Close(); // Test Step: Open Start Booking using any method. Search for and select Record A. toolbar.StartBooking(); NameQuickSearch inmateNameQuickSearch = new NameQuickSearch(NameQuickSearch.getPath()); inmateNameQuickSearch.LastNameQuickSearchTextBox.TextValue = inmateRecordA; inmateNameQuickSearch.SearchButton.Click(); inmateNameQuickSearch.FindCell(inmateRecordA).Click(); inmateNameQuickSearch.SelectNameButton.Click(); // VALIDATE:The information Required dialog opens asking for DOB and gender. CreateInmatePrerequisites createInmatePrerequisites = new CreateInmatePrerequisites(CreateInmatePrerequisites.getPath()); Assert.That(createInmatePrerequisites.DOBTextBox.Visible); createInmatePrerequisites.AddGender("Male"); createInmatePrerequisites.AddDOB("10101987"); Assert.That(createInmatePrerequisites.SubmitButton.Visible); createInmatePrerequisites.SubmitButton.Click(); // VALIDATE: The Start Booking screen is open and includes the name information. StartBooking startBooking = new StartBooking(StartBooking.getPath()); Assert.That(startBooking.LastNameTextBox.Visible); Assert.That(startBooking.LastNameTextBox.Enabled); Assert.AreEqual(startBooking.LastNameTextBox.TextValue, inmateRecordA); startBooking.Close(); }
public void TwoInmatesBookingSmokeTest() { //• Record D - A name record with two inmate records. (Use the Add option on the inmate screen) neither inmate ID should have an open booking. Toolbar toolbar = new Toolbar(Toolbar.getPath()); toolbar.WaitUntilLoads(); toolbar.OpenNames(); NamesTable namesTable = new NamesTable(NamesTable.getPath()); namesTable.AddInmate(inmateRecordD, "10101987", "M", out inmateTempRecord); namesTable.Close(); toolbar.OpenInmates(); Inmate inmate = new Inmate(Inmate.getPath()); inmate.AddInmate(inmateTempRecord); inmate.AddInmate(inmateTempRecord); inmate.Close(); toolbar.StartBooking(); NameQuickSearch inmateNameQuickSearch = new NameQuickSearch(NameQuickSearch.getPath()); inmateNameQuickSearch.LastNameQuickSearchTextBox.TextValue = inmateRecordD; inmateNameQuickSearch.SearchButton.Click(); inmateNameQuickSearch.FindCell(inmateRecordD).Click(); inmateNameQuickSearch.SelectNameButton.Click(); InmateSelector inmateSelector = new InmateSelector(InmateSelector.getPath()); inmateSelector.SelectInmateButton.Click(); StartBooking startBooking = new StartBooking(StartBooking.getPath()); Assert.AreEqual(startBooking.LastNameTextBox.TextValue, inmateRecordD); startBooking.Close(); }
public void BookingJuvenileSmokeTest() { //• Record B - A name record where the DOB places the individual under the Module.Jail.adultAge setting (18) Toolbar toolbar = new Toolbar(Toolbar.getPath()); toolbar.WaitUntilLoads(); toolbar.OpenNames(); NamesTable namesTable = new NamesTable(NamesTable.getPath()); namesTable.AddInmate(inmateRecordB, "10102005", "M"); namesTable.Close(); //Test Step: Start a new booking for Record B. toolbar.StartBooking(); Validate.Exists(NameQuickSearch.getPath(), _searchTime); NameQuickSearch inmateNameQuickSearch = new NameQuickSearch(NameQuickSearch.getPath()); inmateNameQuickSearch.LastNameQuickSearchTextBox.TextValue = inmateRecordB; inmateNameQuickSearch.SearchButton.Click(); inmateNameQuickSearch.FindCell(inmateRecordB).Click(); inmateNameQuickSearch.SelectNameButton.Click(); StartBooking startBooking = new StartBooking(StartBooking.getPath()); startBooking.StartNewButton.Click(); //VALIDATE:The Juvenile Instructions dialog opens and shows the text you added in setup. SpillmanMessageBox msgBox = new SpillmanMessageBox(SpillmanMessageBox.getPath()); Assert.IsTrue(msgBox.Visible); Assert.IsTrue(msgBox.HasText("This person is a juvenile")); msgBox.Close(); startBooking.Close(); }
private void GetCommonNamesTable(ICheckNotifier notifier) { if (_commonNames == null) { if (NamesTable == null) { notifier.OnCheckPerformed( new CheckEventArgs( "No NamesTable has been set, this must be a Table containing a list of names to REDACT from the pipeline data being processed", CheckResult.Fail)); return; } //get access to the database under DataLoad context var databaseDiscovered = DataAccessPortal.GetInstance().ExpectDatabase(NamesTable, DataAccessContext.DataLoad); if (databaseDiscovered.Exists()) { notifier.OnCheckPerformed(new CheckEventArgs("Found Database '" + databaseDiscovered + "' ", CheckResult.Success)); } else { notifier.OnCheckPerformed(new CheckEventArgs("Database '" + databaseDiscovered + "' does not exist ", CheckResult.Fail)); } //expect a table matching the TableInfo var tableDiscovered = databaseDiscovered.ExpectTable(NamesTable.GetRuntimeName()); if (tableDiscovered.Exists()) { notifier.OnCheckPerformed(new CheckEventArgs("Found table '" + tableDiscovered + "' ", CheckResult.Success)); } else { notifier.OnCheckPerformed(new CheckEventArgs("Table '" + tableDiscovered + "' does not exist ", CheckResult.Fail)); } //make sure it exists if (!tableDiscovered.Exists()) { throw new NotSupportedException("TableInfo '" + tableDiscovered + "' does not exist!"); } //Download all the data var dataTable = tableDiscovered.GetDataTable(); //Make sure it has the correct expected schema (i.e. 1 column) if (dataTable.Columns.Count != 1) { throw new NotSupportedException("Expected a single column in DataTable '" + tableDiscovered + "'"); } //turn it into an array _commonNames = dataTable.Rows.Cast <DataRow>().Select(r => r[0] as string).Where(s => !string.IsNullOrWhiteSpace(s)).ToArray(); if (_commonNames.Length == 0) { notifier.OnCheckPerformed(new CheckEventArgs("Table '" + tableDiscovered + "' did not have any rows in it!", CheckResult.Fail)); //reset it just in case _commonNames = null; } else { notifier.OnCheckPerformed(new CheckEventArgs("Read " + _commonNames.Length + " names from name table", CheckResult.Success)); } } }