playwright project
This commit is contained in:
41
LukanNUnitProject/LukanNUnitProject/Tests/AcceptCookie.cs
Normal file
41
LukanNUnitProject/LukanNUnitProject/Tests/AcceptCookie.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
40
LukanNUnitProject/LukanNUnitProject/Tests/DeclineCookie.cs
Normal file
40
LukanNUnitProject/LukanNUnitProject/Tests/DeclineCookie.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
Binary file not shown.
Binary file not shown.
@ -1 +1 @@
|
||||
1950979691
|
||||
690009287
|
@ -1 +1 @@
|
||||
62d05e87b5c4b696db0251f8b60212e06f068668
|
||||
e27b2c6719d9dae0abb0477aa00399fc92a9448b
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2
LukanNUnitProject/LukanPOM/.vscode/settings.json
vendored
Normal file
2
LukanNUnitProject/LukanPOM/.vscode/settings.json
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
{
|
||||
}
|
@ -1 +1 @@
|
||||
953933157
|
||||
1004409487
|
Reference in New Issue
Block a user