diff options
author | Peter Zhang <peter@innocraft.com> | 2021-11-13 02:49:08 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-13 02:49:08 +0300 |
commit | bf341b7c0ba46691bf3e475ebaa58391363cd7ec (patch) | |
tree | 232d4a0ec7aa3b8c801592872eb2d2523dc66f0e /plugins/Feedback/tests/UI | |
parent | 9c58f4e71db9133b2c83d51cf700e818ec5ff7e4 (diff) |
add feedback question, remove other related. (#18262)
* remove feedback links
remove feedback links
* update screen shot
update screen shot
* add feedback question
add feedback question
* update close to icon
update close to icon
* built vue files
* remove in line css
remove in line css, change to less file
* move translation key to plugin
move translation key to plugin
* remove feedback popup
remove feedback popup
* update remove some test and feedback related
update remove some test and feedback related
* add draft tests
add draft tests
* update feedback add php and UI tests
update feedback add php and UI tests
* update test screen shots
update test screen shots
* Update demo.twig
add heart to demo page
* add feedback back in extend the modal
add feedback back in extend the modal
* update coreHome
update coreHome
* update screen shots
update screen shots
* Update FeedbackQuestion_spec.js
update js tests
* update test
update test
* built vue files
* update screenshot and js tests
update screenshot and js tests
* Update FeedbackQuestion_spec.js
test success
* update screenshot
update screenshot
* update tests
update tests
* fix test error
fix test error
* Removing the refer us popup
* Readding accidentally removed language files
* update test
* update test
* remove refer us
* update feedback umd js
update feedback umd js
* merge Andy branch
merge Andy branch and update screen shots
* revert language changes
revert language changes
* revert language changes
revert language changes
* revert language file
revert language file
* revert unrelated lang change
revert unrelated lang change
* revert lang change
revert lang change
* revert lang change
revert lang change
* Delete ControllerTest.php
remove controller test not in used
* Update core/Piwik.php
Co-authored-by: Ben Burgess <88810029+bx80@users.noreply.github.com>
* Update plugins/Morpheus/javascripts/piwikHelper.js
Co-authored-by: Ben Burgess <88810029+bx80@users.noreply.github.com>
* update a big that cancel and reopen it again
update a bug that cancel and reopen it again
* update compare error
update compare error
* Update plugins/Feedback/FeedbackReminder.php
Co-authored-by: Stefan Giehl <stefan@matomo.org>
* update feedback show logic
update feedback show logic
* Update FeedbackQuestion_spec.js
update tests
* Update Feedback.php
remove comments
* Update .gitignore
* update vue build file
update vue build file
* built vue files
* update vue build file
update vue build file
* add close button
add close button
* add close button
add close button
* update screenshot
update screenshot
* remove umd
remove umd
* git add corehome
git add corehome
* revert all the umd file
revert all the umd file
* built vue files
* built vue files
* Update plugins/Feedback/lang/en.json
Co-authored-by: Stefan Giehl <stefan@matomo.org>
* update per review
update per review
* built vue files
* set auto focus on modal open
set auto focus on modal open
* built vue files
* Update FeedbackQuestion.vue
add please write in english
* built vue files
* remove please write in English
remove please write in English
* built vue files
* update tests and question tests
update tests and question tests
* set cookie in the test
set cookie in the test
* Update page-renderer.js
add setCookie to tests
* update test only load 1
update test only load 1
* built vue files
* Update FeedbackQuestion_feedback_popup.png
update screen shot
* Update piwikHelper.js
update button css
* update screen shot
update screen shot
* Update plugins/Feedback/Feedback.php
Co-authored-by: Stefan Giehl <stefan@matomo.org>
* Update plugins/Feedback/vue/src/FeedbackQuestion/FeedbackQuestion.vue
Co-authored-by: Stefan Giehl <stefan@matomo.org>
* Update plugins/Feedback/API.php
Co-authored-by: Stefan Giehl <stefan@matomo.org>
* Update plugins/Feedback/API.php
Co-authored-by: Stefan Giehl <stefan@matomo.org>
* Update core/Plugin/API.php
Co-authored-by: Stefan Giehl <stefan@matomo.org>
* update cookie and tests
update cookie and tests
* built vue files
* test setcookie in tests
test setcookie in tests
* update tests
update tests
* update tests
update tests
* Update FeedbackQuestion_spec.js
update cookie test
* extend setCookie in test
extend setCookie in test
* update elints format
update elints format
* built vue files
* test set cookie
test set cookie
* built vue files
* Update FeedbackQuestion_spec.js
set cookie after goto URL
* Update FeedbackQuestion_spec.js
int to string
* update set cookie
update set cookie
* update test URL
update test URL
Co-authored-by: peterhashair <peterhashair@users.noreply.github.com>
Co-authored-by: Andrew Davis <andrew.affinity@gmail.com>
Co-authored-by: Ben Burgess <88810029+bx80@users.noreply.github.com>
Co-authored-by: Stefan Giehl <stefan@matomo.org>
Diffstat (limited to 'plugins/Feedback/tests/UI')
10 files changed, 66 insertions, 84 deletions
diff --git a/plugins/Feedback/tests/UI/FeedbackPopup_spec.js b/plugins/Feedback/tests/UI/FeedbackPopup_spec.js deleted file mode 100644 index cdfbbeb36e..0000000000 --- a/plugins/Feedback/tests/UI/FeedbackPopup_spec.js +++ /dev/null @@ -1,46 +0,0 @@ -/*! - * Matomo - free/libre analytics platform - * - * UsersManager screenshot tests. - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ - -describe("FeedbackPopup", function () { - this.timeout(0); - this.fixture = "Piwik\\Plugins\\Feedback\\tests\\Fixtures\\FeedbackPopupFixture"; - - var url = "?module=CoreHome&action=index&idSite=1&period=day&date=2019-07-11&forceFeedbackTest=1"; - - before(async function() { - await page.webpage.setViewport({ - width: 1250, - height: 768 - }); - }); - - it('should display popup when next reminder date is in past', async function () { - await page.goto(url); - await page.waitForNetworkIdle(); - - var modal = await page.waitForSelector('.modal.open', { visible: true }); - expect(await modal.screenshot()).to.matchImage('feedback_popup'); - - // Click on the "Remind me in 90 days" button = the popup shouldn't appear for the next test - var remindLaterBtn = await modal.$$('.modal-footer .btn-flat'); - await remindLaterBtn[0].click(); - await page.waitForNetworkIdle(); - }); - - it('should not display popup when next reminder date is in future', async function () { - await page.goto(url); - await page.waitForNetworkIdle(); - - // check dashboard is present - await page.waitForSelector('#dashboardWidgetsArea'); - - // check modal isn't opened - await page.waitForFunction("$('.modal.open').length == 0"); - }); -});
\ No newline at end of file diff --git a/plugins/Feedback/tests/UI/FeedbackQuestion_spec.js b/plugins/Feedback/tests/UI/FeedbackQuestion_spec.js new file mode 100644 index 0000000000..70528468ff --- /dev/null +++ b/plugins/Feedback/tests/UI/FeedbackQuestion_spec.js @@ -0,0 +1,52 @@ +/*! + * Matomo - free/libre analytics platform + * + * UsersManager screenshot tests. + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +describe('FeedbackQuestion', function () { + this.timeout(0); + this.fixture = 'Piwik\\Plugins\\Feedback\\tests\\Fixtures\\FeedbackQuestionBannerFixture'; + + var url = '?module=CoreHome&action=index&idSite=1&period=day&date=2019-07-11&forceFeedbackTest=1'; + + it('should display question banner', async function () { + await page.setCookie({ + name: 'feedback-question', + value: '0', + expire: '3600', + 'url': 'http://localhost/tests/PHPUnit/proxy/' + url, + }); + await page.goto(url); + await page.waitForNetworkIdle(); + + var banner = await page.waitForSelector('.bannerHeader', { visible: true }); + expect(await banner.screenshot()).to.matchImage('feedback_banner'); + }); + + it('should display popup when banner button is clicked', async function () { + await page.click('.bannerHeader .btn'); + await page.waitForNetworkIdle(); + + var popup = await page.waitForSelector('.modal', { visible: true }); + expect(await popup.screenshot()).to.matchImage('feedback_popup'); + }); + + it('should show error when blank content submit', async function () { + await page.click('.modal .modal-footer a:nth-child(1)'); + await page.waitForNetworkIdle(); + var popup = await page.waitForSelector('.modal.open', { visible: true }); + expect(await popup.screenshot()).to.matchImage('feedback_failed'); + }); + + it('should show success when banner is submit', async function () { + await page.type('#message', 'test content, do not send emails'); + await page.click('.modal .modal-footer a:nth-child(1)'); + await page.waitForNetworkIdle(); + var popup = await page.waitForSelector('.modal.open', { visible: true }); + expect(await popup.screenshot()).to.matchImage('feedback_success'); + }); +}); diff --git a/plugins/Feedback/tests/UI/ReferBanner_spec.js b/plugins/Feedback/tests/UI/ReferBanner_spec.js deleted file mode 100644 index 84b8c1bb33..0000000000 --- a/plugins/Feedback/tests/UI/ReferBanner_spec.js +++ /dev/null @@ -1,30 +0,0 @@ -/*! - * Matomo - free/libre analytics platform - * - * UsersManager screenshot tests. - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ - -describe("ReferBannerTest", function () { - this.timeout(0); - this.fixture = "Piwik\\Plugins\\Feedback\\tests\\Fixtures\\ReferBannerFixture"; - - var url = "?module=CoreHome&action=index&idSite=1&period=day&date=2019-07-11&forceFeedbackTest=1"; - - before(async function() { - await page.webpage.setViewport({ - width: 1250, - height: 768 - }); - }); - - it('should display popup when next reminder date is in past', async function () { - await page.goto(url); - await page.waitForNetworkIdle(); - - var banner = await page.waitForSelector('.refer-banner', { visible: true }); - expect(await banner.screenshot()).to.matchImage('feedback_popup'); - }); -}); diff --git a/plugins/Feedback/tests/UI/expected-screenshots/FeedbackForm_show.png b/plugins/Feedback/tests/UI/expected-screenshots/FeedbackForm_show.png index 7ca34edd9d..a7315ae5cd 100644 --- a/plugins/Feedback/tests/UI/expected-screenshots/FeedbackForm_show.png +++ b/plugins/Feedback/tests/UI/expected-screenshots/FeedbackForm_show.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:37bddab33dbd00a473c45f015a96bf420c6b3d9f21e0b4e668e0d569fb9d471f -size 269098 +oid sha256:4b713af0c769a9175d73a73d15f5c58063a2b9135533f1943d97011ca923f93e +size 244192 diff --git a/plugins/Feedback/tests/UI/expected-screenshots/FeedbackPopup_feedback_popup.png b/plugins/Feedback/tests/UI/expected-screenshots/FeedbackPopup_feedback_popup.png deleted file mode 100644 index a6c7a12fe9..0000000000 --- a/plugins/Feedback/tests/UI/expected-screenshots/FeedbackPopup_feedback_popup.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d5e4c0571a535a90244639b4d6f68c9679f53300dd0f1eedd3ac6024d3e0571a -size 27936 diff --git a/plugins/Feedback/tests/UI/expected-screenshots/FeedbackQuestion_feedback_banner.png b/plugins/Feedback/tests/UI/expected-screenshots/FeedbackQuestion_feedback_banner.png new file mode 100644 index 0000000000..eb4ea8dfbd --- /dev/null +++ b/plugins/Feedback/tests/UI/expected-screenshots/FeedbackQuestion_feedback_banner.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:959b1e4ecf2ea17100c3029dc2d1829cec102bc5147ede612103d921e202f0c0 +size 11044 diff --git a/plugins/Feedback/tests/UI/expected-screenshots/FeedbackQuestion_feedback_failed.png b/plugins/Feedback/tests/UI/expected-screenshots/FeedbackQuestion_feedback_failed.png new file mode 100644 index 0000000000..6f36784c47 --- /dev/null +++ b/plugins/Feedback/tests/UI/expected-screenshots/FeedbackQuestion_feedback_failed.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d721f1099ea0597eadfd29561e266e73e2b63b6436655a2d7f00f0757219e447 +size 48461 diff --git a/plugins/Feedback/tests/UI/expected-screenshots/FeedbackQuestion_feedback_popup.png b/plugins/Feedback/tests/UI/expected-screenshots/FeedbackQuestion_feedback_popup.png new file mode 100644 index 0000000000..535df3821d --- /dev/null +++ b/plugins/Feedback/tests/UI/expected-screenshots/FeedbackQuestion_feedback_popup.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:21932d52aa513e50bf7c2e5f9df26fb2e8f861fc16cac7e32e94989e19715018 +size 45154 diff --git a/plugins/Feedback/tests/UI/expected-screenshots/FeedbackQuestion_feedback_success.png b/plugins/Feedback/tests/UI/expected-screenshots/FeedbackQuestion_feedback_success.png new file mode 100644 index 0000000000..cc29343ae3 --- /dev/null +++ b/plugins/Feedback/tests/UI/expected-screenshots/FeedbackQuestion_feedback_success.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1977e1e89607e361282b66298b3f235b42f2de3f1f1b9f325c0c53875119f7f4 +size 16428 diff --git a/plugins/Feedback/tests/UI/expected-screenshots/ReferBannerTest_feedback_popup.png b/plugins/Feedback/tests/UI/expected-screenshots/ReferBannerTest_feedback_popup.png deleted file mode 100644 index bc9ade9144..0000000000 --- a/plugins/Feedback/tests/UI/expected-screenshots/ReferBannerTest_feedback_popup.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:001fa5fc54e4f316dfac5aab1b1802f9620e671dcb83e85279a4843afdfaef67 -size 14794 |