googletest
This commit is contained in:
parent
cdc44d9d0b
commit
dbd498f34e
38
Selenite_Naveen/.gitignore
vendored
Normal file
38
Selenite_Naveen/.gitignore
vendored
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
target/
|
||||||
|
!.mvn/wrapper/maven-wrapper.jar
|
||||||
|
!**/src/main/**/target/
|
||||||
|
!**/src/test/**/target/
|
||||||
|
|
||||||
|
### IntelliJ IDEA ###
|
||||||
|
.idea/modules.xml
|
||||||
|
.idea/jarRepositories.xml
|
||||||
|
.idea/compiler.xml
|
||||||
|
.idea/libraries/
|
||||||
|
*.iws
|
||||||
|
*.iml
|
||||||
|
*.ipr
|
||||||
|
|
||||||
|
### Eclipse ###
|
||||||
|
.apt_generated
|
||||||
|
.classpath
|
||||||
|
.factorypath
|
||||||
|
.project
|
||||||
|
.settings
|
||||||
|
.springBeans
|
||||||
|
.sts4-cache
|
||||||
|
|
||||||
|
### NetBeans ###
|
||||||
|
/nbproject/private/
|
||||||
|
/nbbuild/
|
||||||
|
/dist/
|
||||||
|
/nbdist/
|
||||||
|
/.nb-gradle/
|
||||||
|
build/
|
||||||
|
!**/src/main/**/build/
|
||||||
|
!**/src/test/**/build/
|
||||||
|
|
||||||
|
### VS Code ###
|
||||||
|
.vscode/
|
||||||
|
|
||||||
|
### Mac OS ###
|
||||||
|
.DS_Store
|
8
Selenite_Naveen/.idea/.gitignore
generated
vendored
Normal file
8
Selenite_Naveen/.idea/.gitignore
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
# Default ignored files
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
||||||
|
# Editor-based HTTP Client requests
|
||||||
|
/httpRequests/
|
||||||
|
# Datasource local storage ignored files
|
||||||
|
/dataSources/
|
||||||
|
/dataSources.local.xml
|
7
Selenite_Naveen/.idea/encodings.xml
generated
Normal file
7
Selenite_Naveen/.idea/encodings.xml
generated
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="Encoding">
|
||||||
|
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
|
||||||
|
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
|
||||||
|
</component>
|
||||||
|
</project>
|
14
Selenite_Naveen/.idea/misc.xml
generated
Normal file
14
Selenite_Naveen/.idea/misc.xml
generated
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||||
|
<component name="MavenProjectsManager">
|
||||||
|
<option name="originalFiles">
|
||||||
|
<list>
|
||||||
|
<option value="$PROJECT_DIR$/pom.xml" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_20" default="true" project-jdk-name="20" project-jdk-type="JavaSDK">
|
||||||
|
<output url="file://$PROJECT_DIR$/out" />
|
||||||
|
</component>
|
||||||
|
</project>
|
6
Selenite_Naveen/.idea/vcs.xml
generated
Normal file
6
Selenite_Naveen/.idea/vcs.xml
generated
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
34
Selenite_Naveen/pom.xml
Normal file
34
Selenite_Naveen/pom.xml
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<groupId>cz.lukan</groupId>
|
||||||
|
<artifactId>Selenite_Naveen</artifactId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
|
<name>Selenite_Naveen</name>
|
||||||
|
<url>http://maven.apache.org</url>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
<maven.compiler.source>20</maven.compiler.source>
|
||||||
|
<maven.compiler.target>20</maven.compiler.target>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.codeborne</groupId>
|
||||||
|
<artifactId>selenide</artifactId>
|
||||||
|
<version>6.17.0</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<!-- https://mvnrepository.com/artifact/org.testng/testng -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.testng</groupId>
|
||||||
|
<artifactId>testng</artifactId>
|
||||||
|
<version>7.8.0</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
32
Selenite_Naveen/src/test/java/cz/lukan/GoogleTest.java
Normal file
32
Selenite_Naveen/src/test/java/cz/lukan/GoogleTest.java
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
package cz.lukan;
|
||||||
|
|
||||||
|
import com.codeborne.selenide.CollectionCondition;
|
||||||
|
import com.codeborne.selenide.Condition;
|
||||||
|
import org.openqa.selenium.By;
|
||||||
|
import org.testng.Assert;
|
||||||
|
import org.testng.annotations.Test;
|
||||||
|
import static com.codeborne.selenide.Selenide.*;
|
||||||
|
import static com.codeborne.selenide.Condition.*;
|
||||||
|
|
||||||
|
public class GoogleTest {
|
||||||
|
@Test
|
||||||
|
public void googleSearchTest() {
|
||||||
|
open("https://www.google.com/");
|
||||||
|
// Odmítnutí cookie
|
||||||
|
$ (By.id("W0wltc")).click();
|
||||||
|
// Vyhledávaání
|
||||||
|
$ (By.name("q")).setValue("Naveen AutomationLabs");
|
||||||
|
$ (By.name("btnK")).click();
|
||||||
|
// Ověříme že na stránce je logo Google
|
||||||
|
$(By.id("logo")).shouldHave(appear);
|
||||||
|
// Zkontroluji výsledek hledání na stránce
|
||||||
|
String header = $ (By.xpath("//h3[text()='Welcome to Naveen AutomationLabs - naveen automationlabs']")).getText();
|
||||||
|
System.out.println(header + " " + "test prošel");
|
||||||
|
Assert.assertEquals(header, "Welcome to Naveen AutomationLabs - naveen automationlabs");
|
||||||
|
// Zobrazíme počet výsledků Googlem
|
||||||
|
int headerCount = $$(By.cssSelector(".LC20lb.DKV0Md")).size();
|
||||||
|
System.out.println(headerCount + " " + "počet výsledků");
|
||||||
|
// Můžeme ověřit zadaný počet výsledků
|
||||||
|
$$(By.cssSelector(".LC20lb.DKV0Md")).shouldHave(CollectionCondition.size(14));
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user