Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

material-ui: Test material-ui elements. !!!DO NOT MERGE!!! #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<aspectj.version>1.9.6</aspectj.version>
<driver>chrome</driver>
<driver>edge</driver>
<domain>https://epam.github.io/JDI/</domain>
<allure.testng>2.13.8</allure.testng>
<allure.maven>2.10.0</allure.maven>
Expand All @@ -25,7 +25,7 @@
<!--JDI-->
<dependency>
<groupId>com.epam.jdi</groupId>
<artifactId>jdi-light-html</artifactId>
<artifactId>jdi-light-material-ui</artifactId>
<version>RELEASE</version>
</dependency>
<!--Allure-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
@Url("/contact")
@Title("Contact Us | Baeldung")
public class ContactPage extends WebPage {
@UI("[name=your-name]") TextField firstName;
@UI("[name=your-email]") TextField email;
@UI("[name=your-message]") TextArea message;
@UI("//*[@value='Send your message']") Button send;
@UI("[name=your-name]") public TextField firstName;
@UI("[name=your-email]") public TextField email;
@UI("[name=your-message]") public TextArea message;
@UI("//*[@value='Send your message']") public Button send;
@UI("button.css-47sehv") public Button applyCookies;
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package pageobject.uiobjects.example.site.pages;

import com.epam.jdi.light.elements.composite.WebPage;

import com.epam.jdi.light.elements.pageobjects.annotations.locators.JDropdown;
import com.epam.jdi.light.material.elements.inputs.Select;
//Add any element from material-ui package
public class ContactPage extends WebPage {

@JDropdown(root = "#select") public Select select;
}
8 changes: 5 additions & 3 deletions src/test/java/fewpageobjects/TestsInit.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package fewpageobjects;

import org.testng.annotations.AfterMethod;
import org.testng.annotations.AfterSuite;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.BeforeSuite;
import pageobject.uiobjects.example.baeldung.BaeldungSite;

Expand All @@ -11,14 +13,14 @@
import static pageobject.uiobjects.example.baeldung.BaeldungSite.homePage;

public interface TestsInit {
@BeforeSuite(alwaysRun = true)
@BeforeMethod(alwaysRun = true)
static void setUp() {
logger.setLogLevel(STEP);
// logger.setLogLevel(STEP);
initElements(BaeldungSite.class);
homePage.open();
}

@AfterSuite(alwaysRun = true)
@AfterMethod(alwaysRun = true)
static void teardown() {
close();
}
Expand Down
240 changes: 239 additions & 1 deletion src/test/java/fewpageobjects/tests/ContactsExample.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package fewpageobjects.tests;

import fewpageobjects.TestsInit;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import pageobject.uiobjects.example.baeldung.entities.ContactInfo;

Expand All @@ -12,10 +13,247 @@ public class ContactsExample implements TestsInit {
c.email = "[email protected]";
c.message = "Hi Baeldung!";} );

@BeforeMethod(alwaysRun = true)
public void applyCookies() {
if (contactPage.applyCookies.isDisplayed()) contactPage.applyCookies.click();
}
@Test
public void fillContactTest1() throws InterruptedException {
contactPage.open();
contactPage.asForm().send(MY_CONTACT);
contactPage.asForm().check(MY_CONTACT);
Thread.sleep(2000);
}

@Test
public void fillContactTest2() throws InterruptedException {
contactPage.open();
contactPage.asForm().send(MY_CONTACT);
contactPage.asForm().check(MY_CONTACT);
Thread.sleep(2000);
}

@Test
public void fillContactTest3() throws InterruptedException {
contactPage.open();
contactPage.asForm().send(MY_CONTACT);
contactPage.asForm().check(MY_CONTACT);
Thread.sleep(2000);
}

@Test
public void fillContactTest4() throws InterruptedException {
contactPage.open();
contactPage.asForm().send(MY_CONTACT);
contactPage.asForm().check(MY_CONTACT);
Thread.sleep(2000);
}

@Test
public void fillContactTest5() throws InterruptedException {
contactPage.open();
contactPage.asForm().send(MY_CONTACT);
contactPage.asForm().check(MY_CONTACT);
Thread.sleep(2000);
}

@Test
public void fillContactTest6() throws InterruptedException {
contactPage.open();
contactPage.asForm().send(MY_CONTACT);
contactPage.asForm().check(MY_CONTACT);
Thread.sleep(2000);
}

@Test
public void fillContactTest7() throws InterruptedException {
contactPage.open();
contactPage.asForm().send(MY_CONTACT);
contactPage.asForm().check(MY_CONTACT);
Thread.sleep(2000);
}

@Test
public void fillContactTest8() throws InterruptedException {
contactPage.open();
contactPage.asForm().send(MY_CONTACT);
contactPage.asForm().check(MY_CONTACT);
Thread.sleep(2000);
}

@Test
public void fillContactTest9() throws InterruptedException {
contactPage.open();
contactPage.asForm().send(MY_CONTACT);
contactPage.asForm().check(MY_CONTACT);
Thread.sleep(2000);
}

@Test
public void fillContactTest10() throws InterruptedException {
contactPage.open();
contactPage.asForm().send(MY_CONTACT);
contactPage.asForm().check(MY_CONTACT);
Thread.sleep(2000);
}

@Test
public void fillContactTest11() throws InterruptedException {
contactPage.open();
contactPage.asForm().send(MY_CONTACT);
contactPage.asForm().check(MY_CONTACT);
Thread.sleep(2000);
}

@Test
public void fillContactTest12() throws InterruptedException {
contactPage.open();
contactPage.asForm().send(MY_CONTACT);
contactPage.asForm().check(MY_CONTACT);
Thread.sleep(2000);
}

@Test
public void fillContactTest13() throws InterruptedException {
contactPage.open();
contactPage.asForm().send(MY_CONTACT);
contactPage.asForm().check(MY_CONTACT);
Thread.sleep(2000);
}

@Test
public void fillContactTest14() throws InterruptedException {
contactPage.open();
contactPage.asForm().send(MY_CONTACT);
contactPage.asForm().check(MY_CONTACT);
Thread.sleep(2000);
}

@Test
public void fillContactTest15() throws InterruptedException {
contactPage.open();
contactPage.asForm().send(MY_CONTACT);
contactPage.asForm().check(MY_CONTACT);
Thread.sleep(2000);
}

@Test
public void fillContactTest16() throws InterruptedException {
contactPage.open();
contactPage.asForm().send(MY_CONTACT);
contactPage.asForm().check(MY_CONTACT);
Thread.sleep(2000);
}

@Test
public void fillContactTest17() throws InterruptedException {
contactPage.open();
contactPage.asForm().send(MY_CONTACT);
contactPage.asForm().check(MY_CONTACT);
Thread.sleep(2000);
}

@Test
public void fillContactTest18() throws InterruptedException {
contactPage.open();
contactPage.asForm().send(MY_CONTACT);
contactPage.asForm().check(MY_CONTACT);
Thread.sleep(2000);
}

@Test
public void fillContactTest19() throws InterruptedException {
contactPage.open();
contactPage.asForm().send(MY_CONTACT);
contactPage.asForm().check(MY_CONTACT);
Thread.sleep(2000);
}

@Test
public void fillContactTest20() throws InterruptedException {
contactPage.open();
contactPage.asForm().send(MY_CONTACT);
contactPage.asForm().check(MY_CONTACT);
Thread.sleep(2000);
}

@Test
public void fillContactTest21() throws InterruptedException {
contactPage.open();
contactPage.asForm().send(MY_CONTACT);
contactPage.asForm().check(MY_CONTACT);
Thread.sleep(2000);
}

@Test
public void fillContactTest22() throws InterruptedException {
contactPage.open();
contactPage.asForm().send(MY_CONTACT);
contactPage.asForm().check(MY_CONTACT);
Thread.sleep(2000);
}

@Test
public void fillContactTest23() throws InterruptedException {
contactPage.open();
contactPage.asForm().send(MY_CONTACT);
contactPage.asForm().check(MY_CONTACT);
Thread.sleep(2000);
}

@Test
public void fillContactTest24() throws InterruptedException {
contactPage.open();
contactPage.asForm().send(MY_CONTACT);
contactPage.asForm().check(MY_CONTACT);
Thread.sleep(2000);
}

@Test
public void fillContactTest25() throws InterruptedException {
contactPage.open();
contactPage.asForm().send(MY_CONTACT);
contactPage.asForm().check(MY_CONTACT);
Thread.sleep(2000);
}

@Test
public void fillContactTest26() throws InterruptedException {
contactPage.open();
contactPage.asForm().send(MY_CONTACT);
contactPage.asForm().check(MY_CONTACT);
Thread.sleep(2000);
}

@Test
public void fillContactTest27() throws InterruptedException {
contactPage.open();
contactPage.asForm().send(MY_CONTACT);
contactPage.asForm().check(MY_CONTACT);
Thread.sleep(2000);
}

@Test
public void fillContactTest28() throws InterruptedException {
contactPage.open();
contactPage.asForm().send(MY_CONTACT);
contactPage.asForm().check(MY_CONTACT);
Thread.sleep(2000);
}

@Test
public void fillContactTest29() throws InterruptedException {
contactPage.open();
contactPage.asForm().send(MY_CONTACT);
contactPage.asForm().check(MY_CONTACT);
Thread.sleep(2000);
}

@Test
public void fillContactTest() {
public void fillContactTest30() throws InterruptedException {
contactPage.open();
contactPage.asForm().send(MY_CONTACT);
contactPage.asForm().check(MY_CONTACT);
Thread.sleep(2000);
}
}
2 changes: 2 additions & 0 deletions src/test/java/pageobject/tests/PageObjectExample.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,7 @@ public void openPage() {
loginButton.click();
menuContactForm.click();
contactPage.checkOpened();
//fake call. We do not run this test.
contactPage.select.list();
}
}
6 changes: 3 additions & 3 deletions src/test/resources/general.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="WINDOWS-1251"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Test suite" parallel="classes" thread-count="4">
<suite name="Test suite" parallel="methods" thread-count="5">
<test name="Tests">
<packages>
<package name="fewpageobjects.tests"/>
<package name="nopageobjects.tests"/>
<package name="pageobjects.tests"/>
<!--<package name="nopageobjects.tests"/>
<package name="pageobjects.tests"/>-->
</packages>
</test>
</suite>