diff --git a/tests/api/get-pet.spec.js b/tests/api/get-pet.spec.js new file mode 100644 index 0000000..854e457 --- /dev/null +++ b/tests/api/get-pet.spec.js @@ -0,0 +1,21 @@ +const { test, expect } = require('@playwright/test'); + +const data = [{id: 25, username: 'mariaget', firstName: 'maria', lastName: 'silva', email: 'test@mail.com', password: 'test123', phone: '11985632850', userStatus: 1}] + + +test.describe('New Todo', () => { + test('should allow consult user by API reques', async ({ request }) => { + + await request.post(`/v2/user/createWithArray`, {data}) + + const listUser = await request.get(`/v2/user/${data[0].username}`) + + const body = await listUser.json() + expect([body]).toEqual(data) + }); +}); + + + + + diff --git a/tests/api/pet-post.spec.js b/tests/api/post-pet.spec.js similarity index 72% rename from tests/api/pet-post.spec.js rename to tests/api/post-pet.spec.js index 61a6dcd..61dbf79 100644 --- a/tests/api/pet-post.spec.js +++ b/tests/api/post-pet.spec.js @@ -13,13 +13,6 @@ test.describe('New Todo', () => { }); - test('should allow consult user by API reques', async ({ request }) => { - - const listUser = await request.get(`/v2/user/${data[0].username}`) - - const body = await listUser.json() - expect([body]).toEqual(data) - }); });