diff options
Diffstat (limited to 'plugins/Login/tests/UI/Invite_spec.js')
-rw-r--r-- | plugins/Login/tests/UI/Invite_spec.js | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/plugins/Login/tests/UI/Invite_spec.js b/plugins/Login/tests/UI/Invite_spec.js index d937f2c891..decb080ff0 100644 --- a/plugins/Login/tests/UI/Invite_spec.js +++ b/plugins/Login/tests/UI/Invite_spec.js @@ -1,7 +1,7 @@ /*! * Matomo - free/libre analytics platform * - * login & password reset screenshot tests. + * Accept invitation UI tests * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later @@ -10,11 +10,13 @@ describe('Invite', function () { this.timeout(0); this.fixture = 'Piwik\\Plugins\\Login\\tests\\Fixtures\\PendingUsers'; + this.optionsOverride = { + 'persist-fixture-data': false + }; var pendingUserUrl = '?module=Login&action=acceptInvitation&token=13cb9dcef6cc70b02a640cee30dc8ce9'; var wrongUserUrl = '?module=Login&action=acceptInvitation&token=123'; - it('should display error page', async function (){ await page.goto(wrongUserUrl); expect(await page.screenshot({ fullPage: true })).to.matchImage('error'); @@ -31,8 +33,19 @@ describe('Invite', function () { await page.evaluate(function(){ $('#login_form_submit').click(); }); + await page.waitForNetworkIdle(); expect(await page.screenshot({ fullPage: true })).to.matchImage('wrong_password'); - }); -});
\ No newline at end of file + it('it should login success', async function () { + await page.type('#password', 'abcd1234'); + await page.type('#password_confirm', 'abcd1234'); + await page.evaluate(function(){ + $('#conditionCheck').prop('checked', true); + $('#login_form_submit').click(); + }); + // should show site without data page + await page.waitForNetworkIdle(); + await page.waitForSelector('.site-without-data'); + }); +}); |