17
cypress/e2e/pasteUrlLoginRedirect.cy.js
Normal file
17
cypress/e2e/pasteUrlLoginRedirect.cy.js
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
const urlUnderTest = `https://REDACTED-HOST/login?return-to=aHR0cHM6Ly9sdWNpYS1kZXYuZHNwLmltL2Rpc2NvdmVyL2NvbmZvcm1hbmNlL2xvZy8xODU1MjQ3OTcvY29uZm9ybWFuY2U=`;
|
||||||
|
describe('Conformance', ()=>{
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.visit(urlUnderTest);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('After pasting discover/conformance/log/ page, frontend should redirect to corresponding\
|
||||||
|
page, not login page', () => {
|
||||||
|
cy.get('#account').clear().type(` ${Cypress.env('user').username} `);
|
||||||
|
cy.get('#password').clear().type(` ${Cypress.env('user').password} `);
|
||||||
|
cy.get('.btn-lg').click();
|
||||||
|
cy.get('form').submit();
|
||||||
|
|
||||||
|
cy.contains('Conformance Checking Results').should('be.visible');
|
||||||
|
})
|
||||||
|
|
||||||
|
});
|
||||||
@@ -46,10 +46,8 @@ export default defineStore('loginStore', {
|
|||||||
// 然而有一種情況是使用者在沒有登入的情況下貼上了某一個頁面的網址,
|
// 然而有一種情況是使用者在沒有登入的情況下貼上了某一個頁面的網址,
|
||||||
// 則在此情況下時,我們會在使用者稍後登入後,把使用者帶到剛才記住的 return-to 網址
|
// 則在此情況下時,我們會在使用者稍後登入後,把使用者帶到剛才記住的 return-to 網址
|
||||||
if(this.rememberedReturnToUrl !== "") {
|
if(this.rememberedReturnToUrl !== "") {
|
||||||
console.log('1111', );
|
window.location.href = atob(this.rememberedReturnToUrl);
|
||||||
window.location.href = this.rememberedReturnToUrl;
|
|
||||||
} else {
|
} else {
|
||||||
console.log('2222', );
|
|
||||||
this.$router.push('/login');
|
this.$router.push('/login');
|
||||||
}
|
}
|
||||||
} catch(error) {
|
} catch(error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user