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'); }); }); }); });