Lukan Pom VSCode

This commit is contained in:
Lukáš Kaňka 2023-08-24 17:50:51 +02:00
parent bec7a83b2e
commit 8c14e872ab
14 changed files with 105 additions and 4 deletions

View File

@ -21,6 +21,7 @@ namespace LukanPOM.PageObjects
IWebElement ClickAcceptCookie => driver.FindElement(By.XPath("//div[2]/span"));
IWebElement ClickDeclineCookie => driver.FindElement(By.XPath("//div[3]/span"));
IWebElement ClickZasady => driver.FindElement(By.Id("menu-item-439"));
@ -35,15 +36,28 @@ namespace LukanPOM.PageObjects
ClickAcceptCookie.Click();
}
public void DeclineCookie()
{
ClickDeclineCookie.Click();
}
public void ZasadyOchrany()
{
ClickZasady.Click();
}
public void TitleTest()
public HomePage Titulek()
{
string actualTitle = driver.Title;
string expectedTitle = "Lukáš bloguje - Blog o všem možném i nemožném";
Assert.AreEqual(expectedTitle, actualTitle);
return this;
}
public HomePage TestProsel()
{
Console.Write("Test prošel");
return this;
}

View File

@ -21,12 +21,14 @@ namespace LukanPOM.Common
Driver.Navigate().GoToUrl("https://lukan.cz");
Driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10);
home = new HomePage(Driver);
}
[TearDown]
public void TearDown()
{
Driver.Quit();
}
}

View File

@ -36,5 +36,6 @@ namespace LukanPOM.Tests
}
}

View File

@ -0,0 +1,41 @@
using System;
using OpenQA.Selenium;
using OpenQA.Selenium.Remote;
using NUnit.Framework;
using System.Threading;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using OpenQA.Selenium.Support.UI;
using SeleniumExtras.PageObjects;
using System.Net;
using WebDriverManager;
using WebDriverManager.DriverConfigs.Impl;
using OpenQA.Selenium.Chrome;
using LukanPOM.PageObjects;
using LukanPOM.Common;
namespace LukanPOM.Tests
{
//private IWebDriver? _driver;
internal class DeclineCookie : TestBase
{
[Test]
public void DeclineCookieTest()
{
home.DeclineCookie();
}
}
}

View File

@ -0,0 +1,43 @@
using System;
using OpenQA.Selenium;
using OpenQA.Selenium.Remote;
using NUnit.Framework;
using System.Threading;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using OpenQA.Selenium.Support.UI;
using SeleniumExtras.PageObjects;
using System.Net;
using WebDriverManager;
using WebDriverManager.DriverConfigs.Impl;
using OpenQA.Selenium.Chrome;
using LukanPOM.PageObjects;
using LukanPOM.Common;
namespace LukanPOM.Tests
{
//private IWebDriver? _driver;
internal class TitleTest : TestBase
{
[Test]
public void TitleVerifiTest()
{
home
.Titulek()
.TestProsel();
}
}
}

View File

@ -1 +1 @@
1695163839
2038838343

View File

@ -1 +1 @@
cc6aed74361c6473bdc4ce34a0da9dfb4ecb0290
522f0d163e35eed9582db35738b4b15520a680ec