public void GivenMessage(string key, Table table) { var topic = table.Get("topic"); var sig = table.Get("signature"); FeatureContext.Current.Add(key, new Setup.Message(topic, sig)); }
public void GivenLocation(string key, Table table) { var gln = table.Get("GLN"); var name = table.Get("Name"); FeatureContext.Current.Add(key, new Setup.Location(gln, name)); }
public void WhenCreateALocation(string locId, Table table) { new MainPage(TestSetup.Driver) .SelectCreateLocation(); var locName = $"Location-{RandomString(20)}"; new LocationCreate(TestSetup.Driver) .EnterLocationName(locName) .ClickSetParentButton(); new PopupParentGlnSelection(TestSetup.Driver) .SearchName(table.Get("parent")) .ClickFirstRow() .ClickSetParentGln(); Thread.Sleep(3000); new LocationCreate(TestSetup.Driver) .SelectIndustry(table.Get("industry")); Thread.Sleep(1000); new LocationCreate(TestSetup.Driver) .SelectSupplyChainRole(table.Get("sc_role")) .EnterAddress1(table.Get("address1")) .EnterAddress2($"Suite {RandomNumber(8)}") .EnterCity(table.Get("city")) .SelectState(table.Get("state")) .EnterZip(table.Get("zip")) .EnterPhone(table.Get("phone")) .ClickSave() .WaitSpinner(); new LocationCreate(TestSetup.Driver) .ExpandBusinessAttributesLocationType() .ExpandSectorCorporateRelationship(); Regex.Split(table.Get("location_type").Trim(), @"\s*,\s*") .ToList() .ForEach(x => new LocationCreate(TestSetup.Driver).ClickLocationType(x)); new LocationCreate(TestSetup.Driver) .SelectHcCorporateRelationship(table.Get("corporate_rel")); Thread.Sleep(1000); new LocationCreate(TestSetup.Driver) .SelectClassOfTrade1(table.Get("class_of_trade1")); Thread.Sleep(1000); new LocationCreate(TestSetup.Driver) .SelectClassOfTrade2(table.Get("class_of_trade2")); Thread.Sleep(1000); new LocationCreate(TestSetup.Driver) .SelectClassOfTrade3(table.Get("class_of_trade3")) .ClickSave() .WaitSpinner(); new LocationCreate(TestSetup.Driver) .ClickMakeActive(); new PopupLocationMakeActive(TestSetup.Driver) .ClickContinue(); Thread.Sleep(1000); new LocationCreate(TestSetup.Driver) .WaitSpinner(); Thread.Sleep(1000); var p = new LocationCreate(TestSetup.Driver) .ClickApprove() .WaitSpinner(); Console.WriteLine($"GLN = {p.GLN} LocName = {locName}"); FeatureContext.Current.Add(locId, new Setup.Location(p.GLN, locName)); }