Skip to content
Snippets Groups Projects

Draft: Resolve "Implement user journey tests"

Open trantzas requested to merge 26-implement-user-journey-tests into develop
3 files
+ 82
17
Compare changes
  • Side-by-side
  • Inline
Files
3
+ 41
0
describe('logged user journeys', () => {
//sign user in before each test
beforeEach(() => {
cy.visit("http://localhost:4200/");
//sign in journey through services portal
});
it('logs in through services', () => {
cy.get(':nth-child(2) > .container > .row > :nth-child(2) > a > .btn').click();
//cy.get(':nth-child(1) > .nav-link').click()
cy.location("pathname").should("equal", "/services");
// cy.get('.btn').should("contain", "Sign In").click();
cy.origin('http://portal.openslice.eu', () => {
cy.location("pathname").should("equal", "/auth/realms/openslice/protocol/openid-connect/auth");
cy.get('#username').type('admin');
cy.get('#password').type('openslice');
cy.get('#kc-login').click();
});
//redirect page
cy.location("pathname").should("equal", "/redirect");
//back on services marketplace after login
cy.location("pathname").should("equal", "/services/services_marketplace");
cy.get(':nth-child(2) > #navbarDropdown').each(($link) => {
const url = $link.prop('href');
console.log(url);
if (url) {
cy.request(url).then((response) => {
expect(response.status).to.eq(200); // Ensure link is not broken
});
}
cy.wrap($link).click(); // Click the link
cy.url().should('eq', url); // Ensure navigation happened correctly
cy.go('back'); // Navigate back to check the next link
});
});
})
\ No newline at end of file
Loading