From 62fc5efaaef6a532867a6ac5fdd70e9df25b3414 Mon Sep 17 00:00:00 2001 From: Shinigami Date: Sat, 4 Feb 2023 01:03:38 +0100 Subject: test: use cy.request for e2e (#1808) --- cypress/e2e/api.cy.ts | 10 +++++----- 1 file 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'); + }); }); }); }); -- cgit v1.2.3