|
7 | 7 | } from "nativescript-dev-appium"; |
8 | 8 | import { assert } from "chai"; |
9 | 9 | import { isSauceLab } from "nativescript-dev-appium/lib/parser"; |
| 10 | +import { ImageOptions } from "nativescript-dev-appium/lib/image-options"; |
10 | 11 |
|
11 | 12 | const QUEUE_WAIT_TIME: number = 600000; // Sometimes SauceLabs threads are not available and the tests wait in a queue to start. Wait 10 min before timeout. |
12 | 13 |
|
@@ -49,23 +50,23 @@ describe("page-router-outlet-scenario", async function () { |
49 | 50 | }); |
50 | 51 |
|
51 | 52 | it("should not hide action bar by default", async function () { |
52 | | - const screenMatches = await driver.compareScreen("actionBarVisibility-always-default", 5); |
| 53 | + const screenMatches = await driver.compareScreen("actionBarVisibility-always-default", 5, 50, ImageOptions.pixel); |
53 | 54 | assert(screenMatches); |
54 | 55 | }); |
55 | 56 |
|
56 | 57 | it("should not hide action bar when hidden by page", async function () { |
57 | 58 | const hideActionBarButton = await driver.findElementByAutomationText("HideActionBar"); |
58 | 59 | await hideActionBarButton.click(); |
59 | 60 |
|
60 | | - const screenMatches = await driver.compareScreen("actionBarVisibility-always-hidden", 5); |
| 61 | + const screenMatches = await driver.compareScreen("actionBarVisibility-always-hidden", 5, 50, ImageOptions.pixel); |
61 | 62 | assert(screenMatches); |
62 | 63 | }); |
63 | 64 |
|
64 | 65 | it("should not do anything when shown action bar by page", async function () { |
65 | 66 | const showActionBarButton = await driver.findElementByAutomationText("ShowActionBar"); |
66 | 67 | await showActionBarButton.click(); |
67 | 68 |
|
68 | | - const screenMatches = await driver.compareScreen("actionBarVisibility-always-shown", 5); |
| 69 | + const screenMatches = await driver.compareScreen("actionBarVisibility-always-shown", 5, 50, ImageOptions.pixel); |
69 | 70 | assert(screenMatches); |
70 | 71 | }); |
71 | 72 | }); |
@@ -167,21 +168,21 @@ describe("page-router-outlet-scenario", async function () { |
167 | 168 | }); |
168 | 169 |
|
169 | 170 | it("should show action bar by default", async function () { |
170 | | - const screenMatches = await driver.compareScreen("actionBarVisibility-auto-default", 5); |
| 171 | + const screenMatches = await driver.compareScreen("actionBarVisibility-auto-default", 5, 50, ImageOptions.pixel); |
171 | 172 | assert(screenMatches); |
172 | 173 | }); |
173 | 174 |
|
174 | 175 | it("should hide action bar when hidden by page", async function () { |
175 | 176 | const hideActionBarButton = await driver.findElementByAutomationText("HideActionBar"); |
176 | 177 | await hideActionBarButton.click(); |
177 | | - const screenMatches = await driver.compareScreen("actionBarVisibility-auto-hidden", 5); |
| 178 | + const screenMatches = await driver.compareScreen("actionBarVisibility-auto-hidden", 5, 50, ImageOptions.pixel); |
178 | 179 | assert(screenMatches); |
179 | 180 | }); |
180 | 181 |
|
181 | 182 | it("should show action bar when shown by page", async function () { |
182 | 183 | const showActionBarButton = await driver.findElementByAutomationText("ShowActionBar"); |
183 | 184 | await showActionBarButton.click(); |
184 | | - const screenMatches = await driver.compareScreen("actionBarVisibility-auto-shown", 5); |
| 185 | + const screenMatches = await driver.compareScreen("actionBarVisibility-auto-shown", 5, 50, ImageOptions.pixel); |
185 | 186 | assert(screenMatches); |
186 | 187 | }); |
187 | 188 | }); |
|
0 commit comments