diff --git a/test/acceptance/config_test.js b/test/acceptance/config_test.js index 7f1aa3a67..ff20b073f 100644 --- a/test/acceptance/config_test.js +++ b/test/acceptance/config_test.js @@ -32,7 +32,7 @@ Scenario('change config 5 @WebDriverIO @Puppeteer @Playwright @Protractor @Night Scenario('make API call and check response @Playwright', ({ I }) => { I.amOnPage('/'); - I.makeApiRequest('get', 'https://jsonplaceholder.typicode.com/comments/1'); + I.makeApiRequest('get', 'https://reqres.in/api/users?page=2'); I.seeResponseCodeIsSuccessful(); }); diff --git a/test/data/app/view/form/fetch_call.php b/test/data/app/view/form/fetch_call.php index 2aa442f54..b79ee6aad 100644 --- a/test/data/app/view/form/fetch_call.php +++ b/test/data/app/view/form/fetch_call.php @@ -25,7 +25,7 @@ diff --git a/test/helper/Playwright_test.js b/test/helper/Playwright_test.js index b4f0d56ac..1f5f59f6c 100644 --- a/test/helper/Playwright_test.js +++ b/test/helper/Playwright_test.js @@ -794,7 +794,7 @@ describe('Playwright', function () { describe('#mockRoute, #stopMockingRoute', () => { it('should mock a route', async () => { await I.amOnPage('/form/fetch_call'); - await I.mockRoute('https://jsonplaceholder.typicode.com/comments/1', route => { + await I.mockRoute('https://reqres.in/api/comments/1', route => { route.fulfill({ status: 200, headers: { 'Access-Control-Allow-Origin': '*' }, @@ -804,18 +804,18 @@ describe('Playwright', function () { }); await I.click('GET COMMENTS'); await I.see('this was mocked'); - await I.stopMockingRoute('https://jsonplaceholder.typicode.com/comments/1'); + await I.stopMockingRoute('https://reqres.in/api/comments/1'); await I.click('GET COMMENTS'); - await I.see('postId'); + await I.see('data'); await I.dontSee('this was mocked'); }); }); describe('#makeApiRequest', () => { it('should make 3rd party API request', async () => { - const response = await I.makeApiRequest('get', 'https://jsonplaceholder.typicode.com/comments/1'); + const response = await I.makeApiRequest('get', 'https://reqres.in/api/users?page=2'); expect(response.status()).to.equal(200); - expect(await response.json()).to.include.keys(['id', 'name']); + expect(await response.json()).to.include.keys(['page']); }); it('should make local API request', async () => { @@ -826,10 +826,10 @@ describe('Playwright', function () { it('should convert to axios response with onResponse hook', async () => { let response; I.config.onResponse = (resp) => response = resp; - await I.makeApiRequest('get', 'https://jsonplaceholder.typicode.com/comments/1'); + await I.makeApiRequest('get', 'https://reqres.in/api/users?page=2'); expect(response).to.be.ok; expect(response.status).to.equal(200); - expect(response.data).to.include.keys(['id', 'name']); + expect(response.data).to.include.keys(['page', 'total']); }); }); diff --git a/test/rest/REST_test.js b/test/rest/REST_test.js index b77defdc1..dc7bdc5d7 100644 --- a/test/rest/REST_test.js +++ b/test/rest/REST_test.js @@ -143,9 +143,9 @@ describe('REST', () => { }); it('should be able to parse JSON responses', async () => { - await I.sendGetRequest('https://jsonplaceholder.typicode.com/comments/1'); + await I.sendGetRequest('https://reqres.in/api/comments/1'); await jsonResponse.seeResponseCodeIsSuccessful(); - await jsonResponse.seeResponseContainsKeys(['id', 'name', 'email']); + await jsonResponse.seeResponseContainsKeys(['data', 'support']); }); });