playwright project

This commit is contained in:
Lukáš Kaňka
2023-08-24 22:18:22 +02:00
parent e31b2bd477
commit 37fc3e4933
39 changed files with 111 additions and 19 deletions

View File

@ -0,0 +1,41 @@
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NUnit.Framework;
namespace LukanNUnitProject.Tests
{
internal class AcceptCookie
{
IWebDriver driver = new ChromeDriver();
[SetUp]
public void Setup()
{
driver.Navigate()
.GoToUrl("https://lukan.cz");
//Maximize the browser window
driver.Manage().Window.Maximize();
Console.WriteLine("Author: Lukáš Kaňka");
}
[Test]
public void ClickAcceptCookie()
{
// přijetí cookies
IWebElement cookies = driver.FindElement(By.XPath("//div[2]/span"));
cookies.Click();
}
[TearDown]
public void EndTest()
{
//close the browser
driver.Close();
}
}
}

View File

@ -0,0 +1,40 @@
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NUnit.Framework;
namespace LukanNUnitProject.Tests
{
internal class DeclineCookie
{
IWebDriver driver = new ChromeDriver();
[SetUp]
public void Setup()
{
driver.Navigate()
.GoToUrl("https://lukan.cz");
driver.Manage().Window.Maximize();
Console.WriteLine("Author: Lukáš Kaňka");
}
[Test]
public void ClickDeclineCookie()
{
// přijetí cookies
IWebElement cookies = driver.FindElement(By.XPath("//div[3]/span"));
cookies.Click();
}
[TearDown]
public void EndTest()
{
driver.Close();
}
}
}

View File

@ -1 +1 @@
62d05e87b5c4b696db0251f8b60212e06f068668
e27b2c6719d9dae0abb0477aa00399fc92a9448b

View File

@ -0,0 +1,2 @@
{
}

View File

@ -1 +1 @@
953933157
1004409487