WIP #216. QA mentioned that bugs remained, so we keep working on it.

This commit is contained in:
Cindy Chang
2024-06-11 13:55:00 +08:00
parent 314670eafd
commit 82fe104291
3 changed files with 39 additions and 17 deletions

View File

@@ -1,17 +1,37 @@
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');
})
const conformanceExampleUrl = "https://REDACTED-HOST/discover/conformance/log/185524797/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(() => {
cy.visit(curUrl);
});
it('Positive case: 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');
});
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');
});
});
});
});