xUnit test, runner, delete Playwright

This commit is contained in:
Lukáš Kaňka
2023-08-25 06:54:49 +02:00
parent 37fc3e4933
commit 7ad075bd58
487 changed files with 8139 additions and 103422 deletions

View File

@@ -0,0 +1,37 @@
using Xunit;
using System;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
namespace Google_Search_xUnit;
public class UnitTest1
{
[Fact]
public void Test1()
{
// Otevře stránku google
IWebDriver driver = new ChromeDriver();
driver.Navigate().GoToUrl("https://www.google.com");
driver.Manage().Window.Maximize();
// zamítne cookies google (odmítnout vše)
IWebElement addButton = driver.FindElement(By.Id("W0wltc"));
addButton.Click();
// napíše slovo test do vyhledávání a potvrdí
IWebElement searchBox = driver.FindElement(By.Name("q"));
searchBox.SendKeys("test");
searchBox.Submit();
Thread.Sleep(3000);
driver.Quit();
}
}

View File

@@ -0,0 +1,24 @@
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using Xunit;
namespace Search;
public class UnitTest1
{
[Fact]
public void Test1()
{
IWebDriver driver = new ChromeDriver();
driver.Navigate().GoToUrl("https://www.lukan.cz");
driver.Manage().Window.Maximize();
IWebElement searchBox = driver.FindElement(By.Name("s"));
searchBox.SendKeys("test");
searchBox.Submit();
Thread.Sleep(3000);
driver.Quit();
}
}