Skip to content

Commit 460f874

Browse files
committed
Merge branch 'master' of github.com:digital-delivery-academy/selenium-pom-framework
2 parents 3052e90 + b7d0c82 commit 460f874

File tree

6 files changed

+217
-57
lines changed

6 files changed

+217
-57
lines changed

pom.xml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<groupId>uk.co.evoco</groupId>
66
<artifactId>selenium-pom-framework</artifactId>
7-
<version>1.0.15-SNAPSHOT</version>
7+
<version>1.0.17-SNAPSHOT</version>
88

99
<name>Selenium POM Framework</name>
1010
<url>https://www.github.com/digital-delivery-academy/selenium-pom-framework</url>
@@ -88,11 +88,11 @@
8888
<maven.surefire.version>2.22.2</maven.surefire.version>
8989
<maven.failsafe.version>2.22.2</maven.failsafe.version>
9090
<junit.jupiter.version>5.5.2</junit.jupiter.version>
91-
<jetty.version>9.4.38.v20210224</jetty.version>
91+
<jetty.version>9.4.41.v20210516</jetty.version>
9292
<selenium.version>3.141.59</selenium.version>
93-
<webdriver.manager.version>3.7.1</webdriver.manager.version>
93+
<webdriver.manager.version>4.4.3</webdriver.manager.version>
9494
<slf4j.version>1.6.4</slf4j.version>
95-
<logback.version>1.0.1</logback.version>
95+
<logback.version>1.2.3</logback.version>
9696
<apache.commons.io.version>2.9.0</apache.commons.io.version>
9797
<hamcrest.version>2.2</hamcrest.version>
9898
<jackson.version>2.12.1</jackson.version>
@@ -108,8 +108,8 @@
108108
<sonar.projectKey>digital-delivery-academy_selenium-pom-example</sonar.projectKey>
109109
<sonar.organization>digital-delivery-academy</sonar.organization>
110110
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
111+
<axe.core.version>4.1.2</axe.core.version>
111112
</properties>
112-
113113
<dependencies>
114114
<dependency>
115115
<groupId>org.seleniumhq.selenium</groupId>
@@ -207,6 +207,18 @@
207207
<version>${jetty.version}</version>
208208
<scope>test</scope>
209209
</dependency>
210+
<dependency>
211+
<groupId>com.deque.html.axe-core</groupId>
212+
<artifactId>selenium</artifactId>
213+
<version>${axe.core.version}</version>
214+
<scope>test</scope>
215+
</dependency>
216+
<dependency>
217+
<groupId>com.deque.html.axe-core</groupId>
218+
<artifactId>selenium</artifactId>
219+
<version>4.1.2</version>
220+
<scope>compile</scope>
221+
</dependency>
210222
</dependencies>
211223

212224
<build>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package uk.co.evoco.webdriver;
2+
3+
import com.deque.html.axecore.results.Results;
4+
import com.deque.html.axecore.results.Rule;
5+
import com.deque.html.axecore.selenium.AxeBuilder;
6+
import com.deque.html.axecore.selenium.AxeReporter;
7+
import org.junit.Assert;
8+
import org.openqa.selenium.WebDriver;
9+
import java.io.IOException;
10+
import java.util.List;
11+
12+
public class AccessibilityBase {
13+
private static final String reportPath = System.getProperty("user.dir") + "\\src\\test\\java\\reports\\";
14+
15+
public static void checkAccessibilityViolations(WebDriver webDriver) throws IOException {
16+
String reportFile = reportPath + "accessibilityReport";
17+
AxeBuilder builder = new AxeBuilder();
18+
Results results = builder.analyze(webDriver);
19+
saveReport(results, reportFile);
20+
}
21+
22+
private static void saveReport(Results results, String reportFile) {
23+
List<Rule> violations = results.getViolations();
24+
if (violations.size() == 0) {
25+
Assert.assertTrue("No violations found", true);
26+
} else {
27+
AxeReporter.writeResultsToJsonFile(reportFile, results);
28+
Assert.assertEquals(0, violations.size());
29+
}
30+
}
31+
}

src/main/resources/docs/package-lock.json

Lines changed: 64 additions & 52 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<template>
2+
<div class="configuration">
3+
<div class="row">
4+
<div class="col-md-12">
5+
<h1 class="remove-bottom-margin">Browser Support</h1>
6+
<h2>SauceLabs, Local and working with Safari on MacOS</h2>
7+
</div>
8+
<div class="col-md-6">
9+
<p>We support SauceLabs, running against your own Grid or running "locally" on your machine or in a CI environment.</p>
10+
<p>Driver binaries are supplied by the WebDriverManager which is internal to the framework, so you never need to deal with downloading your own driver binaries and keeping them up to date.</p>
11+
<p>The WebDriverManager detects the version of the browsers that you have installed and brings down the binaries to fit the versions you're running. There's currently no way to override this and provide your own.</p>
12+
<p>If you want to use Safari on MacOs, then you need to enable Safaris Automation Control mode. See Apples documentation here: <a href="https://developer.apple.com/documentation/webkit/testing_with_webdriver_in_safari">Running WebDriver with Safari on macOS</a></p>
13+
<p>Our project is supported by SauceLabs. We support all of the browsers and platforms that SauceLabs does. Please see the SauceLabs tab for more details of how to configure your tests to run with SauceLabs.</p>
14+
</div>
15+
</div>
16+
</div>
17+
</template>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<template>
2+
<div class="configuration">
3+
<div class="row">
4+
<div class="col-md-12">
5+
<h1>Framework Actions</h1>
6+
</div>
7+
<div class="col-md-6">
8+
<p>Framework Actions</p>
9+
<p>The framework actions that we've created are a robust collection of extended, fault/exception tolerant interactions that are based on the core WebDriver interactions.</p>
10+
<p><strong>Note: there is absolutely NO NEED to use these actions UNLESS you're encountering instability in your automation. If you're not, use the base WebDriver implementation.</strong></p>
11+
<p>The framework is designed to tolerate a list of exceptions that is provided in the configuration file. If any of these exceptions are encountered during an interaction they will be handled
12+
and the interaction reattempted periodically until the action is either understood to have been successful by WebDriver or the given or configured timeout is reached.</p>
13+
<p>This provides tolerant interactions that allow automation of stubborn systems, particularly those which have performance problems, are built on legacy platforms or are incredibly complex (where the
14+
user interface is constantly updated). We've found that these interactions are extremely useful when automating COTS products like; PEGA and Seibel.</p>
15+
<ul>
16+
<li><router-link to="/framework-actions/clear">Clear</router-link></li>
17+
<li><router-link to="/framework-actions/click">Click</router-link></li>
18+
<li><router-link to="/framework-actions/find-by">Find By</router-link></li>
19+
<li><router-link to="/framework-actions/get-attribute">Get Attribute</router-link></li>
20+
<li><router-link to="/framework-actions/get-text">Get Text</router-link></li>
21+
<li><router-link to="/framework-actions/javascript-executor">JavaScript Executor</router-link></li>
22+
<li><router-link to="/framework-actions/radio-buttons">Radio Buttons</router-link></li>
23+
<li><router-link to="/framework-actions/select-boxes">Select Boxes</router-link></li>
24+
<li><router-link to="/framework-actions/send-keys">Send Keys</router-link></li>
25+
<li><router-link to="/framework-actions/window-utilities">Window Utilities</router-link></li>
26+
<li><router-link to="/framework-actions/tolerant-exception-handling">Tolerant Exception Handling</router-link></li>
27+
<li><router-link to="/framework-actions/json-utilities">JSON Utilities</router-link></li>
28+
</ul>
29+
</div>
30+
</div>
31+
</div>
32+
</template>

0 commit comments

Comments
 (0)