Skip to content
This repository has been archived by the owner on Jul 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #13 from veraPDF/selenium_version
Browse files Browse the repository at this point in the history
Update selenium version
  • Loading branch information
MaximPlusov authored Mar 31, 2024
2 parents 0e677d0 + 7b6e326 commit 990e403
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 26 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/veraPDF_WebApp_CI_with_Maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ on:
- cron: "05 09 * * 1"
push:
branches: [ "master" ]
# pull_request:
# branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
build:
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ In order to run tests you'll need:
2. Run tests using Maven: `mvn clean install`

### Additional Examples how to start project:
1. `mvn clean install` General profile active by default with baseUrl = https://verapdf.duallab.com/, see property file
2. `mvn test -P GeneralTests -DbaseUrl=https://verapdf.duallab.com/`
3. `mvn test -P HotTests -DbaseUrl=https://verapdf.duallab.com/` Profile Hot tests
4. `mvn test -P DemoTests -DbaseUrl=https://verapdf.duallab.com/` Profile Demo tests
5. `mvn test -Dtest=JobTest -DbaseUrl=https://verapdf.duallab.com/`
1. `mvn clean install` General profile active by default with baseUrl = https://dev.pdf4wcag.duallab.com/, see property file
2. `mvn test -P GeneralTests -DbaseUrl=https://dev.pdf4wcag.duallab.com/`
3. `mvn test -P HotTests -DbaseUrl=https://dev.pdf4wcag.duallab.com/` Profile Hot tests
4. `mvn test -P DemoTests -DbaseUrl=https://dev.pdf4wcag.duallab.com/` Profile Demo tests
5. `mvn test -Dtest=JobTest -DbaseUrl=https://dev.pdf4wcag.duallab.com/`
6. `mvn clean install -Dtest=JobTest#addNewJob`
7. `mvn clean install -Dtest=JobTest,HotTest`

Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@
<dependency>
<groupId>io.github.bonigarcia</groupId>
<artifactId>webdrivermanager</artifactId>
<version>5.5.2</version>
<version>5.7.0</version>
</dependency>

<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>4.8.0</version>
<version>4.18.1</version>
</dependency>

<!-- https://mvnrepository.com/artifact/org.testng/testng -->
Expand Down
7 changes: 4 additions & 3 deletions src/main/java/com/duallab/verapdf/fw/pageobject/AppPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,11 @@ public int validate() {
wait_progress__percentage.until(ExpectedConditions.invisibilityOfElementLocated(By.xpath("//*[@class='progress__percentage']")));
log.info("Done.");

log.info("Waiting summary__compliance ... ");
waitForAndFindWebElement(By.xpath("//*[@class='summary__compliance']"), PropertiesValue.getWaitForDriver());
log.info("Waiting legend ... ");
waitForAndFindWebElement(By.xpath("//*[@class='legend']"), PropertiesValue.getWaitForDriver());
//waitForAndFindWebElement(By.xpath("//*[contains(@href, 'result-details')]"), PropertiesValue.getWaitForDriver());
int compliant = Integer.parseInt(chop(waitForAndFindWebElement(By.xpath("//*[@id='app']//*[@class='summary__compliance']//*"), PropertiesValue.getWaitForDriver()).getText()));
String text = chop(waitForAndFindWebElement(By.xpath("//*[@id='app']//*[@class='legend']//*"), PropertiesValue.getWaitForDriver()).getText());
int compliant = Integer.parseInt(text.split(" ")[0]);
log.info("Done.");
return compliant;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
public class MainPage extends BasicPage {

private static Logger log = Logger.getLogger(MainPage.class.getName());
private final String demoButton = "//main/div/*[@class='btn']";
private final String demoButton = "//header/div/*[@class='btn']";

public MainPage(WebDriver driver) throws IOException {
super(driver);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public void demoCheckProfile() throws Exception {
log.info("Checking ...");
assertThat(mainPage.getTitle()).isEqualTo("veraPDF viewer");
then(mainPage.getDemoButton().getText()).isEqualTo("Go to demo");
then(mainPage.getDemoButton().getAttribute("href")).isEqualTo("https://verapdf.duallab.com/demo");
then(mainPage.getDemoButton().getAttribute("href")).isEqualTo("https://dev.pdf4wcag.duallab.com/demo");
then(mainPage.getDemoButton().getCssValue("color")).isEqualTo("rgba(255, 255, 255, 1)");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ public class EndToEndValidationTest extends BaseTest {
public void checkEndToEndValidation() throws Exception {
MainPage mainPage = new MainPage(app.getDriver()).openMainPage();
log.info("Checking ...");
assertThat(mainPage.getTitle()).isEqualTo("veraPDF viewer");
assertThat(mainPage.getTitle()).isEqualTo("PDF Accessibility checker | PDF/UA and WCAG");

then(mainPage.getDemoButton().getText()).isEqualTo("Start");
then(mainPage.getDemoButton().getAttribute("href")).isEqualTo("https://verapdf.duallab.com/validate");
then(mainPage.getDemoButton().getText()).isEqualTo("Try now");
then(mainPage.getDemoButton().getAttribute("href")).isEqualTo("https://dev.pdf4wcag.duallab.com/validate");

AppPage appPage = mainPage.openAppPage();
assertThat(appPage.getTitle()).isEqualTo("veraPDF for WCAG");
assertThat(appPage.getTitle()).isEqualTo("PDF Accessibility checker | PDF/UA and WCAG");

appPage.dropPDFFile(FILE_NAME);
int compliant = appPage.navigateTo_ConfigureJob().selectProfile(PROFILE_NAME).validate();
assertThat(compliant).isLessThan(100); // expected compliant isLessThan 100%
int passedChecks = appPage.navigateTo_ConfigureJob().selectProfile(PROFILE_NAME).validate();
assertThat(passedChecks).isGreaterThanOrEqualTo(0); // expected passed checks isLessThan 100%

InspectErrorsPage errorsPage = appPage.navigateTo_InspectErrorsPage();
assertThat(errorsPage.getPDFFileName()).isEqualTo(FILE_NAME);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ public class MainPageGUITest extends BaseTest {
public void checkMainPage() throws Exception {
MainPage mainPage = new MainPage(app.getDriver()).openMainPage();
log.info("Checking ...");


System.out.println(mainPage.getDemoButton().getAttribute("id"));
myAssertThat(mainPage.getDemoButton())
.hasAttributeValue("href", "https://verapdf.duallab.com/validate")
.hasAttributeValue("href", "https://dev.pdf4wcag.duallab.com/validate")
.hasAttributeValue("class", "btn")
.hasCSSValue("color", "rgba(255, 255, 255, 1)")
.hasCSSValue("background", "rgb(212, 83, 96) none repeat scroll 0% 0% / auto padding-box border-box");
.hasAttributeValue("id", "try-now-button");
}

@BeforeMethod
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public void hotCheckProfile() throws IOException, InterruptedException {
log.info("Checking ...");
assertThat(mainPage.getTitle()).isEqualTo("veraPDF viewer");
then(mainPage.getDemoButton().getText()).isEqualTo("Go to demo");
then(mainPage.getDemoButton().getAttribute("href")).isEqualTo("https://verapdf.duallab.com/demo");
then(mainPage.getDemoButton().getAttribute("href")).isEqualTo("https://dev.pdf4wcag.duallab.com");
then(mainPage.getDemoButton().getCssValue("color")).isEqualTo("rgba(255, 255, 255, 1)");
}

Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/app.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ driverWaitSeconds=60
driverWaitSecondsForHeavyLoadPlaces=300
driverWaitSecondsForNegativeCheck=2
driverWaitSecondsForStates=600
baseUrl=https://verapdf.duallab.com/
baseUrl=https://dev.pdf4wcag.duallab.com/
screenshotLocation=./target/screenshots/
extractedImagesLocation=./target/extracted-images/
maxRetryCount=1
Expand Down

0 comments on commit 990e403

Please sign in to comment.