-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Redirect to login page when session ends #23783
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 5.x-dev
Are you sure you want to change the base?
Changes from all commits
ed32669
b239e3c
16d0e63
dfaf4d2
b9f42bb
f39b3be
817fe3a
299e8ac
b3085fb
ea2e07c
6c2d364
3b4a765
b26fa85
2495716
1cc9e03
2dfafbc
8132d36
8602d01
4697b81
3efd269
058f2a3
a91a324
1fc11d6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| /*! | ||
| * Matomo - free/libre analytics platform | ||
| * | ||
| * WidgetLoader screenshot tests. | ||
| * | ||
| * @link https://matomo.org | ||
| * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later | ||
| */ | ||
|
|
||
| describe('WidgetLoader', function () { | ||
| this.timeout(0); | ||
|
|
||
| this.fixture = "Piwik\\Tests\\Fixtures\\OneVisit"; | ||
|
|
||
| before(function () { | ||
| testEnvironment.testUseMockAuth = 0; | ||
| testEnvironment.save(); | ||
| }); | ||
|
|
||
| it('should redirect to the landing page when the session cookie is cleared during widget loading', async function () { | ||
| // We try to do an actual login | ||
| await page.goto(""); | ||
| await page.type("#login_form_login", superUserLogin); | ||
| await page.type("#login_form_password", superUserPassword); | ||
| await page.click('#login_form_submit'); | ||
| await page.waitForNetworkIdle(); | ||
|
|
||
| // check dashboard is shown | ||
| await page.waitForSelector('#dashboard'); | ||
| expect(await page.$('#dashboard')).to.be.ok; | ||
| await page.clearCookies(); | ||
|
|
||
| //Click on Dashboard menu item | ||
| const dashboardMenuSelector = 'div.reportingMenu ul li[data-category-id="Dashboard_Dashboard"] ul li:nth-child(1) a'; | ||
| await page.click(dashboardMenuSelector); | ||
| await page.waitForNetworkIdle(); | ||
|
|
||
| const loginForm = await page.waitForSelector('#login_form'); | ||
| expect(loginForm).to.be.ok; | ||
|
|
||
| const errorNotification = await page.waitForSelector('div.system.notification-error'); | ||
| expect(errorNotification).to.be.ok; | ||
|
|
||
| const errorText = await page.evaluate(() => _pk_translate('General_Error')); | ||
| const expectedErrorNotificationText = await page.evaluate(() => _pk_translate('General_YourSessionHasExpired')); | ||
| const expectedText = errorText + ': ' + expectedErrorNotificationText; | ||
| const notificationText = await page.$eval('div.system.notification-error .notification-body', el => el.textContent.trim()); | ||
| expect(notificationText).to.equal(expectedText); | ||
|
|
||
| }); | ||
| }); | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've added the change here instead of in WidgetLoader Thanks @sgiehl |
Uh oh!
There was an error while loading. Please reload this page.