diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2019-05-09 01:26:39 +0300 |
---|---|---|
committer | diosmosis <diosmosis@users.noreply.github.com> | 2019-05-09 01:26:39 +0300 |
commit | 76e60590f486f33a38e7ea08bf941fa57ac904c5 (patch) | |
tree | 695bafa55fcd74d79322ed3885e90c4a17ff3e01 /plugins/MultiSites | |
parent | 461a48e6d7050f73b1c25db98b6f96cff86bd043 (diff) |
Switch UI tests from phantomjs to chrome headless (#14421)
* Make sure xss entries is always an array.
* Update expected test files and submodule.
* Regenerate broken omnifixture dump.
* poc conversion to chrome headless for UI tests, single test works locally
* Get single test to pass on travis & local w/ headless chrome.
* Remove old diff viewer generation, and get output to look the same as before when there is a failure.
* Add global timeout & get ViewDataTableTest to pass.
* Convert BarGraph_spec.js.
* Convert EmptySite_spec.
* Update EvolutionGraph spec for chrome headless.
* Convert GoalsTable test & find/replace for common changes.
* Convert MeasurableManager.
* Another find & replace.
* Get Menus/OptOutForm to pass w/ chrome headless
* Convert PeriodSelector, PieGraph & PivotByDimension UI tests.
* undo unrelated debugging change
* Convert QuickAccess UI tests
* Converts ActionsDataTable UI tests
* reset viewport after each testsuite
* Converts RowEvolution UI tests
* Converts Theme UI tests
* Converts SiteSelector UI tests
* Converts CustomVariables UI test
* Converts DBStats UI test
* Ignore empty responses when calling api/controller
* Converts Dashboard UI tests
* Converts Live UI tests
* Converts SimpleUI tests
* Converts Installation UI tests
* Converts ImageGraph UI tests
* Converts Login UI tests
* Converts Marketplace UI tests
* Converts Insights UI tests
* Converts ReportExporting UI tests
* Converts UIIntegration tests
* Updates ViewDataTable UI tests
* Converts CoreUpdater UI tests
* Converts UsersManager UI tests
* Converts Morpheus UI tests
* Converts MultiSites UI tests
* Fix testEnvironment.callApi handling of array parameters
* Converts Overlay UI tests
* Converts PrivacyManager UI tests
* Converts ScheduledReports UI tests
* Converts SegmentEditor UI tests
* compare pixel difference in images
* Converts PeriodSelector UI tests
* allow a pixel difference
* Converts SingleMetricView UI tests
* Converts SitesManager UI tests
* Converts Transitions UI tests
* Converts MeasurableManager UI tests
* Move Mouse out of screen after each test suite
* Converts PieGraph UI tests
* Ensure cursor is not shown in focused input elements
* Converts VisitorMap UI tests
* Converts CustomLogo UI tests
* Converts BarGraph UI tests
* Converts EvolutionGraph UI tests
* Converts IntranetMeasurable UI tests
* Converts TrackingFailures UI tests
* Converts CampaignBuilder UI tests
* Converts TagManagerTeaser UI tests
* fix request url rewrite for changed port
* Converts TwoFactorAuth UI tests
* do not print full responses in logs, but size instead
* improve additional style injection
* use submodule branches
* fix request interception
* update dependencies
* [TEMP] disable dangerous link checks
* [TEMP] limit tests
* Use puppeteer@next and make sure diffs get uploaded properly.
* Use correct fs function.
* Allow timeout to be specified on command line for UI tests and debug console logs.
* timeout option tweak
* Setup diff dir once before running tests not before each suite.
* fix last commit
* Update screenshots and fix some specs.
* Convert some tests that were not converted during merge.
* updating screenshots
* Updating screenshots and fixing some tests.
* more test fixes
* couple more test fixes
* More test fixes and plugin updates.
* wait for jquery
* Fix some screenshots and tests.
* more test fixes
* debug travis test failure
* remove .only
* more test fixes and updated expected files
* another test fixing iteration
* typo
* another quick test change
* more tests updates
* Test fixes and & more debugging.
* more debugging and test fixes
* more fixes and debugging.
* remove .only
* Another round of fixed tests.
* more debugging & fixes
* more test changes
* more debugging and fixes
* Fixing more tests + some bug fixes.
* Couple more fixes.
* Couple more fixes.
* Fixing tracking failures test
* more fixes
* Last couple fixes hopefully.
* couple more test fixes
* more fixes, bug fix in usersmanager, some test updates
* Some more test fixes/changes.
* more and more fixes
* hoping for a green build
* Do not compare against existing files in dashboard_spec.
* more fixes, re-enabling travis
* really re-enable travis
* Install puppeteer on travis-ci.
* more fixes
* try to fix random failues
* remove return
* Convert some login tests I forgot and update UsersManager expected file
* Fix test for primary key update
* Update AddPrimaryKey.php
* More test fixes + implement synchronous comparison threshold (so no resemblejs)
* More wait fixes + reset token detection fix.
* couple more fixes
* Fix login/overlay screenshot issue & magick command running issue.
* identify is the executable on travis (hopefully) + fix some random failures
* Another run.
* Last fix.
* two more tweaks
* typo
Diffstat (limited to 'plugins/MultiSites')
6 files changed, 59 insertions, 58 deletions
diff --git a/plugins/MultiSites/tests/UI/MultiSites_spec.js b/plugins/MultiSites/tests/UI/MultiSites_spec.js index e73ac3cad3..1283e0fd36 100644 --- a/plugins/MultiSites/tests/UI/MultiSites_spec.js +++ b/plugins/MultiSites/tests/UI/MultiSites_spec.js @@ -14,69 +14,70 @@ describe("MultiSitesTest", function () { var rangeParams = 'idSite=1&period=range&date=2012-08-05,2012-08-15'; var selector = '#multisites,.expandDataTableFooterDrawer'; - var createdSiteId = null; - - before(function (done) { - var callback = function (error, response) { - if (error) { - done(error, response); - return; - } - - createdSiteId = response.value; - done(); - }; - - testEnvironment.callApi("SitesManager.addSite", { + var createdSiteIds = []; + + before(async function() { + var response = await testEnvironment.callApi("SitesManager.addSite", { siteName: '%3CMy%20website%22%27%3E%3B%2C%3F with a very very very very long stupid name', - urls: 'http%3A%2F%2Fpiwik.org'}, - callback); - }); + urls: 'http%3A%2F%2Fpiwik.org%2F' + }); + + createdSiteIds.push(response.value); + + for (var i = 0; i < 50; i++) { + var response = await testEnvironment.callApi("SitesManager.addSite", { + siteName: 'dynamically created page ' + i, + urls: 'http%3A%2F%2Fpiwik.org%2F' + i + }); - after(function (done) { - if (createdSiteId) { - testEnvironment.callApi("SitesManager.deleteSite", {idSite: createdSiteId}, done); + createdSiteIds.push(response.value); } }); - it('should load the all websites dashboard correctly', function (done) { - this.retries(3); - - expect.screenshot('all_websites').to.be.captureSelector(selector, function (page) { - page.load("?" + generalParams + "&module=MultiSites&action=index"); - page.wait(3000); - }, done); + after(async function() { + await createdSiteIds.forEach(async function(createdSiteId) { + await testEnvironment.callApi("SitesManager.deleteSite", {idSite: createdSiteId}); + }); }); - it('should load next page correctly', function (done) { - this.retries(3); + it('should load the all websites dashboard correctly', async function() { + await page.goto("?" + generalParams + "&module=MultiSites&action=index"); + await page.waitFor(500); + await page.waitForNetworkIdle(); - expect.screenshot('all_websites_page_1').to.be.captureSelector(selector, function (page) { - page.click('.paging .next'); - page.wait(1000); - }, done); + expect(await page.screenshotSelector(selector)).to.matchImage('all_websites'); }); - it('should search correctly', function (done) { - expect.screenshot('all_websites_search').to.be.captureSelector(selector, function (page) { - page.sendKeys('.site_search input', 'Site'); - page.click('.site_search .search_ico'); - }, done); + it('should load next page correctly', async function() { + await page.click('.paging .next'); + await page.mouse.move(-10, -10); + await page.waitForNetworkIdle(); + + expect(await page.screenshotSelector(selector)).to.matchImage('all_websites_page_1'); }); - it('should toggle sort order when click on current metric', function (done) { - expect.screenshot('all_websites_changed_sort_order').to.be.captureSelector(selector, function (page) { - page.click('#visits .heading'); - }, done); + it('should search correctly', async function() { + await page.type('.site_search input', 'Site'); + await page.evaluate(function() { + $('.site_search .search_ico').click(); + }); + await page.mouse.move(-10, -10); + await page.waitForNetworkIdle(); + + expect(await page.screenshotSelector(selector)).to.matchImage('all_websites_search'); }); - it('should load the all websites dashboard correctly when period is range', function (done) { - this.retries(3); + it('should toggle sort order when click on current metric', async function() { + await page.click('#visits .heading'); + await page.mouse.move(-10, -10); + await page.waitForNetworkIdle(); - expect.screenshot('all_websites_range').to.be.captureSelector(selector, function (page) { - page.load("?" + rangeParams + "&module=MultiSites&action=index"); - page.wait(3000); - }, done); + expect(await page.screenshotSelector(selector)).to.matchImage('all_websites_changed_sort_order'); }); + it('should load the all websites dashboard correctly when period is range', async function () { + await page.goto("?" + rangeParams + "&module=MultiSites&action=index"); + await page.waitForNetworkIdle(); + expect(await page.screenshotSelector(selector)).to.matchImage('all_websites_range'); + }); }); diff --git a/plugins/MultiSites/tests/UI/expected-screenshots/MultiSitesTest_all_websites.png b/plugins/MultiSites/tests/UI/expected-screenshots/MultiSitesTest_all_websites.png index 8ebf77051f..7c5a10a3e1 100644 --- a/plugins/MultiSites/tests/UI/expected-screenshots/MultiSitesTest_all_websites.png +++ b/plugins/MultiSites/tests/UI/expected-screenshots/MultiSitesTest_all_websites.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5d217c10905d35d772c83d89129896e08a05a899e95bfc6ec53672229d09957e -size 73126 +oid sha256:5dc56787a077fcd23ad741b0cffc04eeb9f959d171e29d6be314b68ab0830a69 +size 274597 diff --git a/plugins/MultiSites/tests/UI/expected-screenshots/MultiSitesTest_all_websites_changed_sort_order.png b/plugins/MultiSites/tests/UI/expected-screenshots/MultiSitesTest_all_websites_changed_sort_order.png index 04a4a5cfff..bc94e458f7 100644 --- a/plugins/MultiSites/tests/UI/expected-screenshots/MultiSitesTest_all_websites_changed_sort_order.png +++ b/plugins/MultiSites/tests/UI/expected-screenshots/MultiSitesTest_all_websites_changed_sort_order.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a51477dd72b89b98fb9906da608416bbbe857fc5af00b4094f0fbf004f07c859 -size 55078 +oid sha256:801708b6d548927b4539ce5a56c8b07b78e56ef13e3344a7c9014bc0fea2f36f +size 54932 diff --git a/plugins/MultiSites/tests/UI/expected-screenshots/MultiSitesTest_all_websites_page_1.png b/plugins/MultiSites/tests/UI/expected-screenshots/MultiSitesTest_all_websites_page_1.png index 8ebf77051f..964f0e07b0 100644 --- a/plugins/MultiSites/tests/UI/expected-screenshots/MultiSitesTest_all_websites_page_1.png +++ b/plugins/MultiSites/tests/UI/expected-screenshots/MultiSitesTest_all_websites_page_1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5d217c10905d35d772c83d89129896e08a05a899e95bfc6ec53672229d09957e -size 73126 +oid sha256:e4b84407f0495a49eac25e406a1ee1fa20d0e317c72accfefba810c910e08ccc +size 71551 diff --git a/plugins/MultiSites/tests/UI/expected-screenshots/MultiSitesTest_all_websites_range.png b/plugins/MultiSites/tests/UI/expected-screenshots/MultiSitesTest_all_websites_range.png index 3861316bec..66fff72b5d 100644 --- a/plugins/MultiSites/tests/UI/expected-screenshots/MultiSitesTest_all_websites_range.png +++ b/plugins/MultiSites/tests/UI/expected-screenshots/MultiSitesTest_all_websites_range.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b49b59a09c20b070e2d9de66c0e6bc78b3e39bb8aefde61c9d9e60b8c87a011d -size 63396 +oid sha256:144b3fdb21ebb578f30dcf3228af21c12de889aa98e1b2b286336f93724d56ad +size 239895 diff --git a/plugins/MultiSites/tests/UI/expected-screenshots/MultiSitesTest_all_websites_search.png b/plugins/MultiSites/tests/UI/expected-screenshots/MultiSitesTest_all_websites_search.png index 7c06652bf5..f9b08f3e35 100644 --- a/plugins/MultiSites/tests/UI/expected-screenshots/MultiSitesTest_all_websites_search.png +++ b/plugins/MultiSites/tests/UI/expected-screenshots/MultiSitesTest_all_websites_search.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0a25c546768a6c95ec1a4aa2507e2a52d40f390f591a02245de3b56e8cc63e20 -size 55046 +oid sha256:04bdfd92aa7956b74a99bceb790ee130a1ba9601ce8cdf16caae21facdb09039 +size 54898 |