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/IntranetMeasurable | |
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/IntranetMeasurable')
5 files changed, 32 insertions, 33 deletions
diff --git a/plugins/IntranetMeasurable/tests/UI/IntranetMeasurable_spec.js b/plugins/IntranetMeasurable/tests/UI/IntranetMeasurable_spec.js index c898da7214..c5c665a448 100644 --- a/plugins/IntranetMeasurable/tests/UI/IntranetMeasurable_spec.js +++ b/plugins/IntranetMeasurable/tests/UI/IntranetMeasurable_spec.js @@ -18,34 +18,36 @@ describe("IntranetMeasurable", function () { testEnvironment.save(); }); - function assertScreenshotEquals(screenshotName, done, test, selector) - { - expect.screenshot(screenshotName).to.be.captureSelector(selector, test, done); - } - - it("should show intranet selection", function (done) { - assertScreenshotEquals("add_new_dialog", done, function (page) { - page.load(url); - page.click('.SitesManager .addSite:first'); - }, '.modal.open'); + it("should show intranet selection", async function () { + await page.goto(url); + await (await page.jQuery('.SitesManager .addSite:first')).click(); + await page.waitFor(500); + + const elem = await page.$('.modal.open'); + expect(await elem.screenshot()).to.matchImage('add_new_dialog'); }); - it("should load intranet specific fields", function (done) { - assertScreenshotEquals("intranet_create", done, function (page) { - page.click('.modal.open .btn:contains(Intranet)'); - page.evaluate(function () { - $('.form-help:contains(UTC time is)').hide(); - }); - page.wait(250); - }, '.editingSite'); + it("should load intranet specific fields", async function () { + await (await page.jQuery('.modal.open .btn:contains(Intranet)')).click(); + await page.waitForNetworkIdle(); + await page.waitFor(250); + + await page.evaluate(function () { + $('.form-help:contains(UTC time is)').hide(); + }); + + pageWrap = await page.$('.editingSite'); + expect(await pageWrap.screenshot()).to.matchImage('intranet_create'); }); - it("should load intranet specific fields", function (done) { - assertScreenshotEquals("intranet_created", done, function (page) { - page.sendKeys('.editingSite [placeholder="Name"]', 'My intranet'); - page.sendKeys('.editingSite [name="urls"]', 'https://www.example.com'); - page.click('.editingSiteFooter input.btn'); - }, '.site[type=intranet]'); + it("should load intranet specific fields", async function () { + await page.type('.editingSite [placeholder="Name"]', 'My intranet'); + await page.type('.editingSite [name="urls"]', 'https://www.example.com'); + await page.click('.editingSiteFooter input.btn'); + await page.waitForNetworkIdle(); + + pageWrap = await page.$('.site[type=intranet]'); + expect(await pageWrap.screenshot()).to.matchImage('intranet_created'); }); });
\ No newline at end of file diff --git a/plugins/IntranetMeasurable/tests/UI/expected-screenshots/IntranetMeasurable_add_new_dialog.png b/plugins/IntranetMeasurable/tests/UI/expected-screenshots/IntranetMeasurable_add_new_dialog.png index 5b20ab7833..5faa2cc65d 100644 --- a/plugins/IntranetMeasurable/tests/UI/expected-screenshots/IntranetMeasurable_add_new_dialog.png +++ b/plugins/IntranetMeasurable/tests/UI/expected-screenshots/IntranetMeasurable_add_new_dialog.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cac978c3f396ebb4ecc6ca23b8670bae8b9a50e9a43bd7598059770df404b39e -size 10580 +oid sha256:5f7b44f6f0100a644c616ff774b63c1fc238fe1dd3a850c74d0a5f7f5575090b +size 8863 diff --git a/plugins/IntranetMeasurable/tests/UI/expected-screenshots/IntranetMeasurable_intranet_create.png b/plugins/IntranetMeasurable/tests/UI/expected-screenshots/IntranetMeasurable_intranet_create.png index 1831ca8cf5..ca0edf6041 100644 --- a/plugins/IntranetMeasurable/tests/UI/expected-screenshots/IntranetMeasurable_intranet_create.png +++ b/plugins/IntranetMeasurable/tests/UI/expected-screenshots/IntranetMeasurable_intranet_create.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:04d65dd8b08a37ace9c33c0c8d7e079e15226b620034b7bd2b64ae012d26fc8a -size 258485 +oid sha256:f1eb52240f94c6fb8455189d20280540e31285c2ed58a7dff2c90a59e9d69856 +size 257977 diff --git a/plugins/IntranetMeasurable/tests/UI/expected-screenshots/IntranetMeasurable_intranet_created.png b/plugins/IntranetMeasurable/tests/UI/expected-screenshots/IntranetMeasurable_intranet_created.png index b993eeb522..0546d2053d 100644 --- a/plugins/IntranetMeasurable/tests/UI/expected-screenshots/IntranetMeasurable_intranet_created.png +++ b/plugins/IntranetMeasurable/tests/UI/expected-screenshots/IntranetMeasurable_intranet_created.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:727f1e38691ad43e1754e3fccd92786783aa01c872339ab0b38585133b548b32 -size 14309 +oid sha256:08609572429712f232feaba4bbc6130859c2f1b418072b5444588dfc07160240 +size 14559 diff --git a/plugins/IntranetMeasurable/tests/UI/expected-screenshots/IntranetMeasurable_intranet_reloaded.png b/plugins/IntranetMeasurable/tests/UI/expected-screenshots/IntranetMeasurable_intranet_reloaded.png deleted file mode 100644 index 5a2630d3de..0000000000 --- a/plugins/IntranetMeasurable/tests/UI/expected-screenshots/IntranetMeasurable_intranet_reloaded.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:bcc87f8a8ae38808f008c8945cf9d353359a31c2b45526ea45ec2513d7743edb -size 258493 |