Skip to content

Commit

Permalink
fix deprecated function
Browse files Browse the repository at this point in the history
  • Loading branch information
shashwatahalder01 committed Oct 12, 2023
1 parent 666becb commit ba97bda
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
1 change: 1 addition & 0 deletions tests/pw/tests/api/admins.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ test.describe('admin api test', () => {
const [response, responseBody] = await apiUtils.get(endPoints.getAdminReportSummary);
expect(response.ok()).toBeTruthy();
expect(responseBody).toBeTruthy();
console.log(responseBody);
expect(responseBody).toMatchSchema(schemas.reportSummarySchema);
});

Expand Down
8 changes: 6 additions & 2 deletions tests/pw/tests/api/orders.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { endPoints } from '@utils/apiEndPoints';
import { payloads } from '@utils/payloads';

let apiUtils: ApiUtils;
let responseBody1;

const versions = ['v1', 'v2'];
for (const version of versions) {
Expand All @@ -22,7 +23,10 @@ for (const version of versions) {

test.beforeAll(async ({ request }) => {
apiUtils = new ApiUtils(request);
[, , orderId] = await apiUtils.createOrder(payloads.createProduct(), payloads.createOrder);
[, responseBody1, orderId,] = await apiUtils.createOrder(payloads.createProduct(), payloads.createOrder);
console.log(responseBody1);
console.log(orderId);

});

test('get all orders @lite', async () => {
Expand All @@ -43,7 +47,7 @@ for (const version of versions) {
expect(responseBody).toBeTruthy();
});

test('get single order @lite', async () => {
test.only('get single order @lite', async () => {
const [response, responseBody] = await apiUtils.get(endPoints.getSingleOrder(orderId).replace('v1', version));
expect(response.ok()).toBeTruthy();

Check failure on line 52 in tests/pw/tests/api/orders.spec.ts

View workflow job for this annotation

GitHub Actions / e2e_api tests

[api_tests] › orders.spec.ts:50:14 › order api test v1 › get single order @lite

1) [api_tests] › orders.spec.ts:50:14 › order api test v1 › get single order @lite ─────────────── Error: expect(received).toBeTruthy() Received: false 50 | test.only('get single order @lite', async () => { 51 | const [response, responseBody] = await apiUtils.get(endPoints.getSingleOrder(orderId).replace('v1', version)); > 52 | expect(response.ok()).toBeTruthy(); | ^ 53 | expect(responseBody).toBeTruthy(); 54 | }); 55 | at /home/runner/work/dokan/dokan/tests/pw/tests/api/orders.spec.ts:52:35

Check failure on line 52 in tests/pw/tests/api/orders.spec.ts

View workflow job for this annotation

GitHub Actions / e2e_api tests

[api_tests] › orders.spec.ts:50:14 › order api test v1 › get single order @lite

1) [api_tests] › orders.spec.ts:50:14 › order api test v1 › get single order @lite ─────────────── Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(received).toBeTruthy() Received: false 50 | test.only('get single order @lite', async () => { 51 | const [response, responseBody] = await apiUtils.get(endPoints.getSingleOrder(orderId).replace('v1', version)); > 52 | expect(response.ok()).toBeTruthy(); | ^ 53 | expect(responseBody).toBeTruthy(); 54 | }); 55 | at /home/runner/work/dokan/dokan/tests/pw/tests/api/orders.spec.ts:52:35

Check failure on line 52 in tests/pw/tests/api/orders.spec.ts

View workflow job for this annotation

GitHub Actions / e2e_api tests

[api_tests] › orders.spec.ts:50:14 › order api test v2 › get single order @lite

2) [api_tests] › orders.spec.ts:50:14 › order api test v2 › get single order @lite ─────────────── Error: expect(received).toBeTruthy() Received: false 50 | test.only('get single order @lite', async () => { 51 | const [response, responseBody] = await apiUtils.get(endPoints.getSingleOrder(orderId).replace('v1', version)); > 52 | expect(response.ok()).toBeTruthy(); | ^ 53 | expect(responseBody).toBeTruthy(); 54 | }); 55 | at /home/runner/work/dokan/dokan/tests/pw/tests/api/orders.spec.ts:52:35

Check failure on line 52 in tests/pw/tests/api/orders.spec.ts

View workflow job for this annotation

GitHub Actions / e2e_api tests

[api_tests] › orders.spec.ts:50:14 › order api test v2 › get single order @lite

2) [api_tests] › orders.spec.ts:50:14 › order api test v2 › get single order @lite ─────────────── Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(received).toBeTruthy() Received: false 50 | test.only('get single order @lite', async () => { 51 | const [response, responseBody] = await apiUtils.get(endPoints.getSingleOrder(orderId).replace('v1', version)); > 52 | expect(response.ok()).toBeTruthy(); | ^ 53 | expect(responseBody).toBeTruthy(); 54 | }); 55 | at /home/runner/work/dokan/dokan/tests/pw/tests/api/orders.spec.ts:52:35
expect(responseBody).toBeTruthy();
Expand Down
8 changes: 4 additions & 4 deletions tests/pw/utils/testData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,7 @@ export const data = {
companyId: faker.string.alphanumeric(5),
vatNumber: faker.string.alphanumeric(10),
bankIban: faker.finance.iban(),
phoneNumber: faker.phone.number('(###) ###-####'),
phoneNumber: faker.phone.number(),
phone: '0123456789',
street1: 'abc street',
street2: 'xyz street',
Expand Down Expand Up @@ -1279,7 +1279,7 @@ export const data = {
firstName: faker.person.firstName('male'),
lastName: faker.person.lastName('male'),
email: faker.internet.email(),
phone: faker.phone.number('(###) ###-####'),
phone: faker.phone.number(),
password: String(process.env.USER_PASSWORD),
}),

Expand All @@ -1306,7 +1306,7 @@ export const data = {
bankName: 'bankName',
bankAddress: 'bankAddress',
bankIban: faker.finance.iban(),
phone: faker.phone.number('(###) ###-####'),
phone: faker.phone.number(),
street1: 'abc street',
street2: 'xyz street',
country: 'United States (US)',
Expand Down Expand Up @@ -1522,7 +1522,7 @@ export const data = {
fullName: faker.person.fullName({ sex: 'male' }),
email: faker.person.firstName('male') + '@email.com',
companyName: faker.company.name(),
phoneNumber: faker.phone.number('(###) ###-####'),
phoneNumber: faker.phone.number(),
}),
},

Expand Down

0 comments on commit ba97bda

Please sign in to comment.