WIP #216. QA mentioned that bugs remained, so we keep working on it.
This commit is contained in:
@@ -1,10 +1,14 @@
|
|||||||
const urlUnderTest = `https://REDACTED-HOST/login?return-to=aHR0cHM6Ly9sdWNpYS1kZXYuZHNwLmltL2Rpc2NvdmVyL2NvbmZvcm1hbmNlL2xvZy8xODU1MjQ3OTcvY29uZm9ybWFuY2U=`;
|
const conformanceExampleUrl = "https://REDACTED-HOST/discover/conformance/log/185524797/conformance";
|
||||||
describe('Conformance', ()=>{
|
const urlUnderTestNotEncoded = `https://REDACTED-HOST/login?return-to=${conformanceExampleUrl}`;
|
||||||
|
const urlsUnderTest = [urlUnderTestNotEncoded,];
|
||||||
|
describe('Conformance url pastetd', ()=>{
|
||||||
|
urlsUnderTest.forEach((curUrl) => {
|
||||||
|
context(`Testing with URL: ${curUrl}`, () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.visit(urlUnderTest);
|
cy.visit(curUrl);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('After pasting discover/conformance/log/ page, frontend should redirect to corresponding\
|
it('Positive case: After pasting discover/conformance/log/ page, frontend should redirect to corresponding\
|
||||||
page, not login page', () => {
|
page, not login page', () => {
|
||||||
cy.get('#account').clear().type(`${Cypress.env('user').username}`);
|
cy.get('#account').clear().type(`${Cypress.env('user').username}`);
|
||||||
cy.get('#password').clear().type(`${Cypress.env('user').password}`);
|
cy.get('#password').clear().type(`${Cypress.env('user').password}`);
|
||||||
@@ -12,6 +16,22 @@ describe('Conformance', ()=>{
|
|||||||
cy.get('form').submit();
|
cy.get('form').submit();
|
||||||
|
|
||||||
cy.contains('Conformance Checking Results').should('be.visible');
|
cy.contains('Conformance Checking Results').should('be.visible');
|
||||||
})
|
});
|
||||||
|
|
||||||
|
it('Negative case: User who is logged out cannout access inner pages', () => {
|
||||||
|
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.get('#logout_btn').click();
|
||||||
|
|
||||||
|
cy.visit(curUrl);
|
||||||
|
|
||||||
|
cy.contains('Account').should('be.visible');
|
||||||
|
cy.contains('Password').should('be.visible');
|
||||||
|
cy.contains('Conformance Checking Results').should('not.exist');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
1
gamunu.vscode-yarn
Submodule
1
gamunu.vscode-yarn
Submodule
Submodule gamunu.vscode-yarn added at 6f18600396
@@ -105,7 +105,8 @@ export default {
|
|||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
// 考慮到使用者可能在未登入的情況下貼入一個頁面網址連結過來瀏覽器
|
// 考慮到使用者可能在未登入的情況下貼入一個頁面網址連結過來瀏覽器
|
||||||
this.setRememberedReturnToUrl(this.$route.query['return-to']);
|
// btoa: 對字串進行 Base64 編碼
|
||||||
|
this.setRememberedReturnToUrl(btoa(this.$route.query['return-to']));
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user