Skip to content

Commit 5fcda2b

Browse files
Merge pull request #26 from aquality-automation/visual-testing
[Visualization] Visual testing scenarios
2 parents 7fa9b4f + a5b737c commit 5fcda2b

File tree

4 files changed

+28
-8
lines changed

4 files changed

+28
-8
lines changed

aquality-selenium-template-cucumber/src/test/java/aquality/selenium/template/cucumber/features/Demo.feature

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@ Feature: Demo
55
Given Main page is opened
66
When I open Contact us page
77
Then Contact us page is opened
8-
When I fill contact form using following data:
9-
| Name | Peter Parker |
10-
| Company | Aquality Automation |
11-
| Phone | +44 208 816 7320 |
12-
| Comment | I'd like to contact you! |
13-
And I accept Privacy and Cookies Policy
14-
And I click Send button
8+
When I save Contact us page dump
9+
And I fill contact form using following data:
10+
| Name | Peter Parker |
11+
| Company | Aquality Automation |
12+
| Phone | +44 208 816 7320 |
13+
| Comment | I'd like to contact you! |
14+
And I accept Privacy and Cookies Policy
15+
And I click Send button
1516
Then Notification about empty fields is present
17+
And Contact us page dump is different
1618

1719
@demo
1820
Scenario Outline: ScenarioContext demo

aquality-selenium-template-cucumber/src/test/java/aquality/selenium/template/cucumber/stepdefinitions/ui/ContactUsPageSteps.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,14 @@ public void checkEmptyFieldWarning() {
4444
assertTrue(contactUsPage.isEmailValidationMessagePresent(),
4545
"Email validation message should be displayed");
4646
}
47+
48+
@When("I save Contact us page dump")
49+
public void saveContactUsPageDump() {
50+
contactUsPage.dump().save();
51+
}
52+
53+
@Then("Contact us page dump is different")
54+
public void contactUsPageDumpIsDifferent() {
55+
assertTrue(contactUsPage.dump().compare() > 0, "The form dump should differ");
56+
}
4757
}

aquality-selenium-template/src/main/resources/settings.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,5 +113,13 @@
113113
},
114114
"elementCache": {
115115
"isEnabled": false
116+
},
117+
"visualization": {
118+
"imageExtension": "png",
119+
"maxFullFileNameLength": 255,
120+
"defaultThreshold": 0.012,
121+
"comparisonWidth": 16,
122+
"comparisonHeight": 16,
123+
"pathToDumps": "./src/test/resources/visualDumps/"
116124
}
117125
}

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<dependency>
3333
<groupId>com.github.aquality-automation</groupId>
3434
<artifactId>aquality-selenium</artifactId>
35-
<version>3.2.1</version>
35+
<version>4.0.0</version>
3636
</dependency>
3737

3838
<dependency>

0 commit comments

Comments
 (0)