Skip to content
Snippets Groups Projects
Commit 354c9046 authored by tzanmix's avatar tzanmix
Browse files

fixed-config

parent 7d2e373e
No related branches found
No related tags found
1 merge request!22Draft: Resolve "Implement user journey tests"
This commit is part of merge request !22. Comments created here will be created in the context of that merge request.
......@@ -5,5 +5,7 @@ export default defineConfig({
setupNodeEvents(on, config) {
// implement node event listeners here
},
baseUrl: "http://localhost:4200/",
pageLoadTimeout: 80000
},
});
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
const baseUrl = Cypress.config('baseUrl');
describe('user journey', () => {
beforeEach(() => {
cy.visit('http://localhost:4200/');
cy.visit(baseUrl);
})
context('user-not-logged-in', () => {
context.skip('user-not-logged-in', () => {
it('checks services portal', () => {
cy.get(':nth-child(2) > .container > .row > :nth-child(2) > a > .btn').click();
//cy.get(':nth-child(1) > .nav-link').click()
......@@ -99,14 +101,13 @@ describe('user journey', () => {
});
});
//infinite loop
// it.only('checks linkedin link', () => {
// cy.get(':nth-child(2) > .ng-star-inserted > :nth-child(1)').click();
// cy.origin('https://www.linkedin.com/company/openslice/', ()=> {
// cy.location("pathname").should("equal", "/");
// });
// });
it.only('checks slack link', () => {
it('checks linkedin link', () => {
cy.get(':nth-child(2) > .ng-star-inserted > :nth-child(1)').click();
cy.origin('https://www.linkedin.com/company/openslice', ()=> {
cy.location("pathname").should("equal", "/company/openslice");
});
});
it('checks slack link', () => {
cy.get(':nth-child(2) > .ng-star-inserted > :nth-child(2)').click();
cy.origin('https://openslice.slack.com/', () => {
cy.location("pathname").should("equal", "/");
......@@ -114,12 +115,33 @@ describe('user journey', () => {
});
});
//twitter test cannot pass, depends on user login
// it.only('checks twitter link', () => {
// cy.get(':nth-child(2) > .ng-star-inserted > :nth-child(3)').click();
// cy.origin('https://x.com/OpensliceOSS', () => {
// cy.location("pathname").should("equal", '/')
// });
// });
it('checks twitter link', () => {
cy.get(':nth-child(2) > .ng-star-inserted > :nth-child(3)').click();
cy.origin('https://x.com/OpensliceOSS', () => {
cy.location("pathname").should("satisfy", (url) => {
return url === '/OpensliceOSS' || url === '/i/flow/login';
})
});
});
it('checks ecosystem link', () => {
cy.get('.col-md-10 > :nth-child(1) > a').click();
cy.origin('https://osl.etsi.org/ecosystem/', () => {
cy.location("pathname").should("equal", "/ecosystem/");
});
});
//never loads, timeout
it.skip('opens terms and conditions', () => {
cy.get('[href="https://osl.etsi.org/files/SDG_OSL_Terms_and_Conditions.pdf"]').click();
// cy.origin('https://osl.etsi.org/files/SDG_OSL_Terms_and_Conditions.pdf/', () => {
// cy.location("pathname").should("equal", "/files/SDG_OSL_Terms_and_Conditions.pdf/")
// })
})
it('checks osl etsi link', () => {
cy.get('[target="_blank"]').click();
cy.location("pathname").should("equal", "/")
})
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment