Skip to content

Commit

Permalink
Fix landing page e2e test assertion.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hyperkid123 committed Jul 10, 2023
1 parent d74a689 commit bd3b853
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
8 changes: 6 additions & 2 deletions cypress/e2e/release-gate/favorite-services.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ describe('Favorite-services', () => {
cy.visit('/');
cy.login();
cy.visit('/');
cy.reload();
cy.intercept('GET', '/api/chrome-service/v1/user', {
data: {
id: 2435,
Expand Down Expand Up @@ -42,6 +41,12 @@ describe('Favorite-services', () => {
},
},
});
cy.intercept({
method: 'GET',
url: '**/services/services.json',
}).as('services');

cy.wait('@services').its('response.statusCode').should('equal', 200);
// check if a favorites link exists on the page
cy.get('.pf-c-menu-toggle__text').click();
cy.contains('View all services').click();
Expand All @@ -67,7 +72,6 @@ describe('Favorite-services', () => {
});
cy.contains(serviceName).parent('.chr-c-favorite-trigger.chr-c-icon-favorited').should('exist');
cy.get('.pf-c-brand').click();
cy.reload();
cy.intercept('GET', '/api/chrome-service/v1/user', {
data: {
id: 24353452,
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/release-gate/landing-page.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ describe('Landing page', () => {
cy.wait('@services').its('response.statusCode').should('equal', 200);

// check if a favorites link exists on the page
cy.contains('View my favorite services').should('exist');
cy.contains('My favorite services').should('exist');
});
});
3 changes: 2 additions & 1 deletion cypress/e2e/spec.cy.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
describe('empty spec', () => {
it('passes', () => {
cy.visit('https://example.cypress.io');
// authenticate the session
cy.login();
});
});

0 comments on commit bd3b853

Please sign in to comment.