Skip to content

Commit 62fc5ef

Browse files
authored
test: use cy.request for e2e (#1808)
1 parent ff53587 commit 62fc5ef

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

cypress/e2e/api.cy.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ describe('API Test', () => {
3232
const text = $el.find('a').text();
3333
const link = $el.find('a').attr('href');
3434

35-
cy.visit(`/api/${link}`);
36-
37-
cy.get('h2').should('include.text', text);
38-
cy.get('h1').should('not.include.text', 'PAGE NOT FOUND');
39-
cy.go('back');
35+
cy.request(`/api/${link}`).should((response) => {
36+
expect(response.status).to.eq(200);
37+
expect(response.body).to.include(text);
38+
expect(response.body).to.not.include('PAGE NOT FOUND');
39+
});
4040
});
4141
});
4242
});

0 commit comments

Comments
 (0)