[TestFixture]
public class CETestsActionDev
{
private IWebDriver driver;
private readonly string environment = "dev";
private static int _randomNumber;
[SetUp]
public void Setup()
{
//They re commented because if not, code in gbActions doesnt find even "userName"
//ChromeOptions options = new();
//options.AddArgument("start-maximized");
//options.AddArgument("--disable-gpu");
//options.AddArgument("--headless");
driver = new ChromeDriver();
driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10);
}
[Test]
public void SuccessCloudExpertProfile()
{
Thread.Sleep(TimeSpan.FromSeconds(5));
driver.Navigate().GoToUrl("https:comapnyExemplo.com");
Thread.Sleep(TimeSpan.FromSeconds(10));
string emailDev = "[email protected]";
driver.FindElement(By.XPath("//*[@id='userName']")).SendKeys(emailDev);
driver.FindElement(By.XPath("//*[@id='password']")).SendKeys("testCloud2Gether");
Thread.Sleep(TimeSpan.FromSeconds(1));
driver.FindElement(By.XPath("//*[@id='buttonForm']")).Click();
Thread.Sleep(TimeSpan.FromSeconds(10));
AddPublicNameAndAboutField(driver);
//First xpath from this method is "name"
AddLanguages(driver);
RemoveLanguages(driver);
CorrectAdress(driver);
}
GitHub 操作 Yaml:
测试项目路径:C2GSeleniumTeste.csproj步骤: