diff options
| author | Shinigami <[email protected]> | 2023-02-04 01:03:38 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-02-04 01:03:38 +0100 |
| commit | 62fc5efaaef6a532867a6ac5fdd70e9df25b3414 (patch) | |
| tree | 02baf94623ec0b825abdb2b3d7de849c1c006bef | |
| parent | ff5358732fdbd224ef8c7e71a9591fa4fd68da3c (diff) | |
| download | faker-62fc5efaaef6a532867a6ac5fdd70e9df25b3414.tar.xz faker-62fc5efaaef6a532867a6ac5fdd70e9df25b3414.zip | |
test: use cy.request for e2e (#1808)
| -rw-r--r-- | cypress/e2e/api.cy.ts | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/cypress/e2e/api.cy.ts b/cypress/e2e/api.cy.ts index ec21d3d3..a79c1957 100644 --- a/cypress/e2e/api.cy.ts +++ b/cypress/e2e/api.cy.ts @@ -32,11 +32,11 @@ describe('API Test', () => { const text = $el.find('a').text(); const link = $el.find('a').attr('href'); - cy.visit(`/api/${link}`); - - cy.get('h2').should('include.text', text); - cy.get('h1').should('not.include.text', 'PAGE NOT FOUND'); - cy.go('back'); + cy.request(`/api/${link}`).should((response) => { + expect(response.status).to.eq(200); + expect(response.body).to.include(text); + expect(response.body).to.not.include('PAGE NOT FOUND'); + }); }); }); }); |
