diff options
Diffstat (limited to 'plugins/Tour')
8 files changed, 50 insertions, 51 deletions
diff --git a/plugins/Tour/tests/UI/Tour_spec.js b/plugins/Tour/tests/UI/Tour_spec.js index c279cb8f6e..17499b0edc 100644 --- a/plugins/Tour/tests/UI/Tour_spec.js +++ b/plugins/Tour/tests/UI/Tour_spec.js @@ -16,73 +16,72 @@ describe("Tour", function () { var widgetUrl = "?" + widgetizeParams + "&" + generalParams + "&moduleToWidgetize=Tour&actionToWidgetize=getEngagement"; - function setCompleteAllChallenges() + async function setCompleteAllChallenges() { testEnvironment.completeAllChallenges = 1; testEnvironment.save(); } - function setCompleteNoChallenges() + async function setCompleteNoChallenges() { testEnvironment.completeNoChallenge = 1; testEnvironment.save(); } - before(function () { + before(async function () { testEnvironment.pluginsToLoad = ['Tour']; testEnvironment.save(); }); - afterEach(function () { + afterEach(async function () { delete testEnvironment.completeAllChallenges; delete testEnvironment.completeNoChallenge; testEnvironment.save(); }); - it('should load widget', function (done) { - expect.screenshot('widget_initial').to.be.capture(function (page) { - page.load(widgetUrl); - }, done); + it('should load widget', async function () { + await page.goto(widgetUrl); + expect(await page.screenshot()).to.matchImage('widget_initial'); }); - it('should skip goal step', function (done) { - expect.screenshot('widget_skipped_goal').to.be.capture(function (page) { - page.click('.tourChallenge.define_goal .icon-hide'); - }, done); + it('should skip goal step', async function () { + await page.click('.tourChallenge.define_goal .icon-hide'); + expect(await page.screenshot()).to.matchImage('widget_skipped_goal'); }); - it('should mark some challanges as completed', function (done) { - expect.screenshot('widget_complete_some_challenges').to.be.capture(function (page) { - page.load('?module=Widgetize&action=iframe&disableLink=0&widget=1&moduleToWidgetize=Actions&viewDataTable=table&flat=1&actionToWidgetize=getPageUrls&idSite=1&period=range&date=2018-01-02,2018-01-03&disableLink=1&widget=1&'); - page.load('?module=Widgetize&action=iframe&forceView=1&viewDataTable=VisitorLog&small=1&disableLink=0&widget=1&moduleToWidgetize=Live&actionToWidgetize=getLastVisitsDetails&idSite=1&period=day&date=yesterday&disableLink=1&widget=1'); - page.load('?module=Widgetize&action=iframe&disableLink=0&widget=1&moduleToWidgetize=Live&actionToWidgetize=getVisitorProfilePopup&idSite=1&period=day&date=yesterday&disableLink=1&widget=1'); - page.load(widgetUrl); - }, done); + it('should mark some challanges as completed', async function () { + await page.goto('?module=Widgetize&action=iframe&disableLink=0&widget=1&moduleToWidgetize=Actions&viewDataTable=table&flat=1&actionToWidgetize=getPageUrls&idSite=1&period=range&date=2018-01-02,2018-01-03&disableLink=1&widget=1&'); + await page.goto('?module=Widgetize&action=iframe&forceView=1&viewDataTable=VisitorLog&small=1&disableLink=0&widget=1&moduleToWidgetize=Live&actionToWidgetize=getLastVisitsDetails&idSite=1&period=day&date=yesterday&disableLink=1&widget=1'); + await page.goto('?module=Widgetize&action=iframe&disableLink=0&widget=1&moduleToWidgetize=Live&actionToWidgetize=getVisitorProfilePopup&idSite=1&period=day&date=yesterday&disableLink=1&widget=1'); + await page.goto(widgetUrl); + expect(await page.screenshot()).to.matchImage('widget_complete_some_challenges'); }); - it('go to page 2', function (done) { - expect.screenshot('widget_complete_some_challenges_page_2').to.be.capture(function (page) { - page.click('.nextChallenges'); - }, done); + it('go to page 2', async function () { + await page.evaluate(function () { + $('.nextChallenges').click(); + }); + await page.waitForNetworkIdle(); + expect(await page.screenshot()).to.matchImage('widget_complete_some_challenges_page_2'); }); - it('go to page 3', function (done) { - expect.screenshot('widget_complete_some_challenges_page_3').to.be.capture(function (page) { - page.click('.nextChallenges'); - }, done); + it('go to page 3', async function () { + await page.evaluate(function () { + $('.nextChallenges').click(); + }); + await page.waitForNetworkIdle(); + expect(await page.screenshot()).to.matchImage('widget_complete_some_challenges_page_3'); }); - it('should load widget when all completed', function (done) { - expect.screenshot('widget_all_completed').to.be.capture(function (page) { - setCompleteAllChallenges(); - page.load(widgetUrl); - }, done); + it('should load widget when all completed', async function () { + await setCompleteAllChallenges(); + await page.goto(widgetUrl); + expect(await page.screenshot()).to.matchImage('widget_all_completed'); }); - it('should load widget when none completed', function (done) { - expect.screenshot('widget_none_completed').to.be.capture(function (page) { - setCompleteNoChallenges(); - page.load(widgetUrl); - }, done); + it('should load widget when none completed', async function () { + await setCompleteNoChallenges(); + await page.goto(widgetUrl); + expect(await page.screenshot()).to.matchImage('widget_none_completed'); }); });
\ No newline at end of file diff --git a/plugins/Tour/tests/UI/expected-screenshots/Tour_widget_all_completed.png b/plugins/Tour/tests/UI/expected-screenshots/Tour_widget_all_completed.png index 5e890b9d95..4e19605d6f 100644 --- a/plugins/Tour/tests/UI/expected-screenshots/Tour_widget_all_completed.png +++ b/plugins/Tour/tests/UI/expected-screenshots/Tour_widget_all_completed.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f5c31f92ec13b6fe54fffae548f5c68cb58481e0b08992731d900411bd6028b0 -size 24218 +oid sha256:5374a8d03964b8f825383e4beff072adec16d3490458afe26a6fae6b26d05177 +size 22444 diff --git a/plugins/Tour/tests/UI/expected-screenshots/Tour_widget_complete_some_challenges.png b/plugins/Tour/tests/UI/expected-screenshots/Tour_widget_complete_some_challenges.png index f40040dc7a..153fa04d82 100644 --- a/plugins/Tour/tests/UI/expected-screenshots/Tour_widget_complete_some_challenges.png +++ b/plugins/Tour/tests/UI/expected-screenshots/Tour_widget_complete_some_challenges.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f315a984ce4d7df8b838badf1336e13c10de411faa89b80c47fada8585c421c6 -size 42324 +oid sha256:09f202b87b46e6c8aa22e23d1a0028f56420db4151e608908e07f65afad81c16 +size 40526 diff --git a/plugins/Tour/tests/UI/expected-screenshots/Tour_widget_complete_some_challenges_page_2.png b/plugins/Tour/tests/UI/expected-screenshots/Tour_widget_complete_some_challenges_page_2.png index bb7781a37c..79ff44d4cc 100644 --- a/plugins/Tour/tests/UI/expected-screenshots/Tour_widget_complete_some_challenges_page_2.png +++ b/plugins/Tour/tests/UI/expected-screenshots/Tour_widget_complete_some_challenges_page_2.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:412c5a03700014a1d8b67fa9a2b36497ce0c6805579f100cf0cd575a1a0185d1 -size 43612 +oid sha256:e1d73ab96ec560d88c71848b02ee886ce7478b6c6c33d60cdcae5ef196d4115f +size 41832 diff --git a/plugins/Tour/tests/UI/expected-screenshots/Tour_widget_complete_some_challenges_page_3.png b/plugins/Tour/tests/UI/expected-screenshots/Tour_widget_complete_some_challenges_page_3.png index 9ef1d0f7c0..636ec02d4f 100644 --- a/plugins/Tour/tests/UI/expected-screenshots/Tour_widget_complete_some_challenges_page_3.png +++ b/plugins/Tour/tests/UI/expected-screenshots/Tour_widget_complete_some_challenges_page_3.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:109b2c705dfdda471b31c15251e91ae939a6ec4799e2f8f7c90b0f3791232f77 -size 46790 +oid sha256:4b6d3c57f1f83f8b2b36906df7273e4b38d2c25edd8207cd439c04c25b55bbef +size 44551 diff --git a/plugins/Tour/tests/UI/expected-screenshots/Tour_widget_initial.png b/plugins/Tour/tests/UI/expected-screenshots/Tour_widget_initial.png index bbceffa327..0d542b51f0 100644 --- a/plugins/Tour/tests/UI/expected-screenshots/Tour_widget_initial.png +++ b/plugins/Tour/tests/UI/expected-screenshots/Tour_widget_initial.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b711be6cbe2ff5a6fc100e176088cd8bfe7c8548d432d1dc48fb0793089411ed -size 43767 +oid sha256:8d3f2a17529617b13f4732fc6b0da98f9cba0d02344dfaf54d991336f4223625 +size 41324 diff --git a/plugins/Tour/tests/UI/expected-screenshots/Tour_widget_none_completed.png b/plugins/Tour/tests/UI/expected-screenshots/Tour_widget_none_completed.png index 007c7d1d45..239ab9cd01 100644 --- a/plugins/Tour/tests/UI/expected-screenshots/Tour_widget_none_completed.png +++ b/plugins/Tour/tests/UI/expected-screenshots/Tour_widget_none_completed.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b1a9f7f97f6ee3b8ca9c5ec8183f77b984cbe3687f2a7a77950ac1c5721914a0 -size 43870 +oid sha256:f39827aa764d0978a78dd283d17595492f04b066c3b6b511fb1d15b4f5ea197e +size 41506 diff --git a/plugins/Tour/tests/UI/expected-screenshots/Tour_widget_skipped_goal.png b/plugins/Tour/tests/UI/expected-screenshots/Tour_widget_skipped_goal.png index 71034b28e7..8ba44f5179 100644 --- a/plugins/Tour/tests/UI/expected-screenshots/Tour_widget_skipped_goal.png +++ b/plugins/Tour/tests/UI/expected-screenshots/Tour_widget_skipped_goal.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:134971197018ea22394e692624f12b7666bb93e5d203cca9491e9273c4fa3263 -size 43692 +oid sha256:9094c93577c6134e8258d21b7f82cc078789b994561d1b664d68d4631f95112f +size 41297 |