本文整理汇总了C#中TechTalk类的典型用法代码示例。如果您正苦于以下问题:C# TechTalk类的具体用法?C# TechTalk怎么用?C# TechTalk使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TechTalk类属于命名空间,在下文中一共展示了TechTalk类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ThenIShouldSeeTheFollowingData
public void ThenIShouldSeeTheFollowingData(TechTalk.SpecFlow.Table table)
{
foreach (var header in table.Header)
{
Assert.AreEqual(_browser.Element(header).Text, table.Rows[0][header]);
}
}
示例2: GivenIAmRegisteredWithTheFollowingData
public void GivenIAmRegisteredWithTheFollowingData(TechTalk.SpecFlow.Table table)
{
var tableSerialized = new SerializableTable(table);
username = tableSerialized.Rows[0]["email"];
password = tableSerialized.Rows[0]["password"];
//mobile = tableSerialized.Rows[0]["mobile"];
//gender = tableSerialized.Rows[0]["gender"];
Deleporter.Run(() =>
{
var mockRepository = new Mock<IRegisterRepository>();
mockRepository.Setup(x => x.Get(tableSerialized.Rows[0]["email"]))
.Returns((from row in tableSerialized.Rows
select new RegisterEntry
{
Name = tableSerialized.Rows[0]["name"],
Password = tableSerialized.Rows[0]["password"],
Email = tableSerialized.Rows[0]["email"],
Mobile = tableSerialized.Rows[0]["mobile"],
Gender = Convert.ToChar(tableSerialized.Rows[0]["gender"][0]),
Activated = tableSerialized.Rows[0]["activated"] == "yes" ? true : false
}).ToList()[0]);
NinjectControllerFactoryUtils.TemporarilyReplaceBinding<IRegisterRepository>(mockRepository.Object);
});
//ScenarioContext.Current.Pending();
}
示例3: ThenTheNewlyCreatedTaskIsDisplayedInTheList
public void ThenTheNewlyCreatedTaskIsDisplayedInTheList(TechTalk.SpecFlow.Table table)
{
foreach (var tableRow in table.Rows)
{
Assert.IsTrue(WebBrowser.Current.ContainsText(tableRow["Value"]));
}
}
示例4: WhenIAdoptForThesePets
public void WhenIAdoptForThesePets(TechTalk.SpecFlow.Table petNames)
{
IWebDriver driver = ScenarioContext.Current["driver"] as IWebDriver;
for (int i = 0; i < petNames.RowCount; i++)
{
ReadOnlyCollection<IWebElement> nameLabels = driver.FindElements(By.ClassName("name"));
ReadOnlyCollection<IWebElement> viewDetailsButtons = driver.FindElements(By.XPath("//input[@value='View Details']"));
var petName = petNames.Rows[i][0];
Console.WriteLine("taking care of " + petName);
for (int j = 0; j < nameLabels.Count; j++)
{
if (nameLabels[j].Text == petName)
{
Console.WriteLine("FOUND: " + petName);
viewDetailsButtons[j].Click();
IWebElement adoptMeButton = driver.FindElement(By.XPath("//input[@value='Adopt Me!']"));
adoptMeButton.Click();
if (petNames.RowCount == i + 1)
{
IWebElement completeTheAdoptionButton = driver.FindElement(By.XPath("//input[@value='Complete the Adoption']"));
completeTheAdoptionButton.Click();
}
else
{
IWebElement adoptAnotherButton = driver.FindElement(By.XPath("//input[@value='Adopt Another Puppy']"));
adoptAnotherButton.Click();
}
break;
}
}
}
}
示例5: ScenarioSetup
public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo)
{
testRunner.OnScenarioStart(scenarioInfo);
if(this.driver != null)
ScenarioContext.Current.Add("Driver", this.driver);
this.sauceRest = new SauceRest("user_name", "access_key", "https://saucelabs.com/rest/v1");
}
示例6: GivenIFillInTheFormAsFollows
public void GivenIFillInTheFormAsFollows(TechTalk.SpecFlow.Table table)
{
foreach (var row in table.Rows) {
var labelText = row["Label"];
var value = row["Value"];
WebBrowser.Current.TextFields.First(Find.ByLabelText(labelText)).TypeText(value);
}
}
示例7: ScenarioSetup
public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo)
{
testRunner.OnScenarioStart(scenarioInfo);
if(this.driver != null)
ScenarioContext.Current.Add("Driver", this.driver);
if(this.container != null)
ScenarioContext.Current.Add("Container", this.container);
}
示例8: WhenIAdoptForThesePets
public void WhenIAdoptForThesePets(TechTalk.SpecFlow.Table petNames)
{
for (int i = 0; i < petNames.RowCount; i++)
{
var petName = petNames.Rows[i][0];
Console.WriteLine("Adopting " + petName);
adoptingSteps.adopt_a_pet(petName, petNames.RowCount == i + 1);
}
}
示例9: GivenIHaveFilledOutTheFormAsFollows
public void GivenIHaveFilledOutTheFormAsFollows(TechTalk.SpecFlow.Table table)
{
foreach (var row in table.Rows)
{
var labelText = row["Label"] + ":";
var value = row["Value"];
_browser.TextFields.First(Find.ByLabelText(labelText)).TypeText(value);
}
}
示例10: ShouldShowFollowingErrorMessages
public void ShouldShowFollowingErrorMessages(TechTalk.SpecFlow.Table table)
{
IWebElement element;
foreach (TechTalk.SpecFlow.TableRow row in table.Rows)
{
element = BrowserUtility.Browser.FindElementWithWait(By.CssSelector("span[data-valmsg-for='" + row["id"] + "']"));
element.Text.Should().Be(row["value"]);
}
}
示例11: TheGeneralRiskAssessmentsTableShouldNotContainTheFollowingData
public void TheGeneralRiskAssessmentsTableShouldNotContainTheFollowingData(string type, TechTalk.SpecFlow.Table table)
{
var searchResultsTable = WebBrowser.Current.Tables.First();
Assert.AreEqual(table.Rows.Count, searchResultsTable.TableRows.Count());
foreach (var row in table.Rows)
{
Assert.Null(searchResultsTable.FindRow(row["Reference"], 0));
}
}
示例12: FillFieldsWithFollowingData
public void FillFieldsWithFollowingData(TechTalk.SpecFlow.Table table)
{
IWebElement element;
foreach (TechTalk.SpecFlow.TableRow row in table.Rows)
{
element = BrowserUtility.Browser.FindElementWithWait(By.CssSelector("input[id='" + row["id"] + "']"));
element.SendKeys(row["value"]);
}
}
示例13: WhenIFillInTheUserForm
public void WhenIFillInTheUserForm(TechTalk.SpecFlow.Table table)
{
Thread.Sleep(2500);
HostUserPage.UserNameField.Value = table.Rows[0]["Value"];
HostUserPage.FirstNameField.Value = table.Rows[1]["Value"];
HostUserPage.LastNameField.Value = table.Rows[2]["Value"];
HostUserPage.DisplayNameField.Value = table.Rows[3]["Value"];
HostUserPage.EmailField.Value = table.Rows[4]["Value"];
HostUserPage.PasswordField.Value = table.Rows[5]["Value"];
HostUserPage.ConfirmPasswordField.Value = table.Rows[5]["Value"];
}
示例14: GivenIHaveEnteredValidDataInTheFormFields
public void GivenIHaveEnteredValidDataInTheFormFields(TechTalk.SpecFlow.Table table)
{
foreach (var tableRow in table.Rows)
{
var field = WebBrowser.Current.TextField(Find.ByName(tableRow["Field"]));
if (!field.Exists)
Assert.Fail(String.Format("Could not find {0} field on page", field));
field.TypeText(tableRow["Value"]);
}
}
示例15: WtedyMamyWyswietlonaListeWszystkichAlertow
public void WtedyMamyWyswietlonaListeWszystkichAlertow(TechTalk.SpecFlow.Table table)
{
foreach(var row in table.Rows)
{
var element = WebBrowser.Current.ElementWithTag("dt", Find.ByText(row["name"]));
if (!element.Exists)
{
Assert.Fail("Lista nie zawiera alertu o nazwie '{0}'", row["name"]);
}
}
}