HomePage vid 2 9:30

This commit is contained in:
Lukáš Kaňka 2023-08-23 09:48:32 +02:00
parent 04aa589f45
commit e39f027f8e
10 changed files with 33 additions and 4 deletions

View File

@ -10,11 +10,18 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DotNetSeleniumExtras.PageObjects.Core" Version="4.3.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.0" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.4.2" />
<PackageReference Include="NUnit.Analyzers" Version="3.6.1" />
<PackageReference Include="coverlet.collector" Version="3.2.0" />
<PackageReference Include="Selenium.Support" Version="4.11.0" />
<PackageReference Include="Selenium.WebDriver" Version="4.11.0" />
</ItemGroup>
<ItemGroup>
<Folder Include="Tests\" />
</ItemGroup>
</Project>

View File

@ -1,2 +1,11 @@
**Projekt VisualStudio 2022**
NUnit Page Object Model
Založit nový NUnit projekt
Do projektu do instalovat Packages: Selenium.WebDriver a Selenium.Support
Dále je potřeba do vyhledávaní packages zadat: dotnetselenium a nainstalovat DotNetSeleniumExtras.PageObjects.Core
Návod jak na POM:
https://www.youtube.com/watch?v=Cr8oLGTSDB4&list=PL6SXxvjnlkaTNJu7G9ZpGpJGnhAFu79UZ&index=2

View File

@ -1,4 +1,5 @@
using System;
using OpenQA.Selenium;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -6,7 +7,19 @@ using System.Threading.Tasks;
namespace NUnitPageObjectModel.Source.Pages
{
internal class HomePage
public class HomePage
{
private IWebDriver _driver;
public HomePage(IWebDriver driver)
{
_driver = driver;
}
public void Search(string searchText)
{
_driver.FindElement(By.Id("twoabsearchtextbox"));
}
}
}