Skip to content

fixing branding test #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/helpers/branding.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import Env from "./env";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

Bruh, what's good with this import statement change? You swapped out the direct URL for a dynamic one from Env.URL. Make sure this change doesn't mess up the URL resolution logic. 🤔


export const defaultBranding = {
name: "Shady Meadows B&B",
map: {
latitude: 52.6351204,
longitude: 1.2733774,
},
logoUrl: "https://automationintesting.online/images/rbp-logo.jpg",
logoUrl: `${Env.URL}/images/room2.jpg`,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

Yo, fam! The logoUrl change looks lit, but ensure that Env.URL resolves to the correct base URL. Keep an eye on this one! 🔍

description:
"Welcome to Shady Meadows, a delightful Bed & Breakfast nestled in the hills on Newingtonfordburyshire. A place so beautiful you will never want to leave. All our rooms have comfortable beds and we provide breakfast from the locally sourced supermarket. It is a delightful place.",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

This description block seems chill, no issues here. 🌟

contact: {
Comment on lines +1 to 12

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

Note: This review was outside of the patch, but no patch was found that overlapped with it. Original lines [13-13]

No changes detected in this line range.

Keep it sharp, developer! Remember, details matter when it comes to code changes. Don't let those bugs sneak in like ninjas in the night! 💥🐰

Expand Down
3 changes: 2 additions & 1 deletion tests/branding/branding.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

expect(response.status()).toBe(200);
const body = await response.json();
expect(body).toEqual(defaultBodyShort);

Check failure on line 18 in tests/branding/branding.spec.ts

View workflow job for this annotation

GitHub Actions / playwright-automation-checks

[api-checks] › branding/branding.spec.ts:13:7 › branding/ GET requests @branding › GET website branding @happy

1) [api-checks] › branding/branding.spec.ts:13:7 › branding/ GET requests @Branding › GET website branding @happy Error: expect(received).toEqual(expected) // deep equality - Expected - 1 + Received + 1 @@ -4,11 +4,11 @@ "email": "[email protected]", "name": "Shady Meadows B&B", "phone": "012345678901", }, "description": "Welcome to Shady Meadows, a delightful Bed & Breakfast nestled in the hills on Newingtonfordburyshire. A place so beautiful you will never want to leave. All our rooms have comfortable beds and we provide breakfast from the locally sourced supermarket. It is a delightful place.", - "logoUrl": "/images/rbp-logo.jpg", + "logoUrl": "https://automationintesting.online//images/room2.jpg", "map": Object { "latitude": 52.6351204, "longitude": 1.2733774, }, "name": "Shady Meadows B&B", 16 | expect(response.status()).toBe(200); 17 | const body = await response.json(); > 18 | expect(body).toEqual(defaultBodyShort); | ^ 19 | 20 | await validateJsonSchema("GET_branding", "branding", body); 21 | await validateAgainstSchema(body, "Branding", "branding"); at /home/runner/work/playwright-api-test-demo/playwright-api-test-demo/tests/branding/branding.spec.ts:18:18

Check failure on line 18 in tests/branding/branding.spec.ts

View workflow job for this annotation

GitHub Actions / playwright-automation-checks

[api-checks] › branding/branding.spec.ts:13:7 › branding/ GET requests @branding › GET website branding @happy

1) [api-checks] › branding/branding.spec.ts:13:7 › branding/ GET requests @Branding › GET website branding @happy Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(received).toEqual(expected) // deep equality - Expected - 1 + Received + 1 @@ -4,11 +4,11 @@ "email": "[email protected]", "name": "Shady Meadows B&B", "phone": "012345678901", }, "description": "Welcome to Shady Meadows, a delightful Bed & Breakfast nestled in the hills on Newingtonfordburyshire. A place so beautiful you will never want to leave. All our rooms have comfortable beds and we provide breakfast from the locally sourced supermarket. It is a delightful place.", - "logoUrl": "/images/rbp-logo.jpg", + "logoUrl": "https://automationintesting.online//images/room2.jpg", "map": Object { "latitude": 52.6351204, "longitude": 1.2733774, }, "name": "Shady Meadows B&B", 16 | expect(response.status()).toBe(200); 17 | const body = await response.json(); > 18 | expect(body).toEqual(defaultBodyShort); | ^ 19 | 20 | await validateJsonSchema("GET_branding", "branding", body); 21 | await validateAgainstSchema(body, "Branding", "branding"); at /home/runner/work/playwright-api-test-demo/playwright-api-test-demo/tests/branding/branding.spec.ts:18:18

Check failure on line 18 in tests/branding/branding.spec.ts

View workflow job for this annotation

GitHub Actions / playwright-automation-checks

[api-checks] › branding/branding.spec.ts:13:7 › branding/ GET requests @branding › GET website branding @happy

1) [api-checks] › branding/branding.spec.ts:13:7 › branding/ GET requests @Branding › GET website branding @happy Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(received).toEqual(expected) // deep equality - Expected - 1 + Received + 1 @@ -4,11 +4,11 @@ "email": "[email protected]", "name": "Shady Meadows B&B", "phone": "012345678901", }, "description": "Welcome to Shady Meadows, a delightful Bed & Breakfast nestled in the hills on Newingtonfordburyshire. A place so beautiful you will never want to leave. All our rooms have comfortable beds and we provide breakfast from the locally sourced supermarket. It is a delightful place.", - "logoUrl": "/images/rbp-logo.jpg", + "logoUrl": "https://automationintesting.online//images/room2.jpg", "map": Object { "latitude": 52.6351204, "longitude": 1.2733774, }, "name": "Shady Meadows B&B", 16 | expect(response.status()).toBe(200); 17 | const body = await response.json(); > 18 | expect(body).toEqual(defaultBodyShort); | ^ 19 | 20 | await validateJsonSchema("GET_branding", "branding", body); 21 | await validateAgainstSchema(body, "Branding", "branding"); at /home/runner/work/playwright-api-test-demo/playwright-api-test-demo/tests/branding/branding.spec.ts:18:18

Check failure on line 18 in tests/branding/branding.spec.ts

View workflow job for this annotation

GitHub Actions / playwright-automation-checks

[api-checks] › branding/branding.spec.ts:13:7 › branding/ GET requests @branding › GET website branding @happy

1) [api-checks] › branding/branding.spec.ts:13:7 › branding/ GET requests @Branding › GET website branding @happy Error: expect(received).toEqual(expected) // deep equality - Expected - 1 + Received + 1 @@ -4,11 +4,11 @@ "email": "[email protected]", "name": "Shady Meadows B&B", "phone": "012345678901", }, "description": "Welcome to Shady Meadows, a delightful Bed & Breakfast nestled in the hills on Newingtonfordburyshire. A place so beautiful you will never want to leave. All our rooms have comfortable beds and we provide breakfast from the locally sourced supermarket. It is a delightful place.", - "logoUrl": "/images/rbp-logo.jpg", + "logoUrl": "https://automationintesting.online//images/room2.jpg", "map": Object { "latitude": 52.6351204, "longitude": 1.2733774, }, "name": "Shady Meadows B&B", 16 | expect(response.status()).toBe(200); 17 | const body = await response.json(); > 18 | expect(body).toEqual(defaultBodyShort); | ^ 19 | 20 | await validateJsonSchema("GET_branding", "branding", body); 21 | await validateAgainstSchema(body, "Branding", "branding"); at /home/runner/work/playwright-api-test-demo/playwright-api-test-demo/tests/branding/branding.spec.ts:18:18

Check failure on line 18 in tests/branding/branding.spec.ts

View workflow job for this annotation

GitHub Actions / playwright-automation-checks

[api-checks] › branding/branding.spec.ts:13:7 › branding/ GET requests @branding › GET website branding @happy

1) [api-checks] › branding/branding.spec.ts:13:7 › branding/ GET requests @Branding › GET website branding @happy Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(received).toEqual(expected) // deep equality - Expected - 1 + Received + 1 @@ -4,11 +4,11 @@ "email": "[email protected]", "name": "Shady Meadows B&B", "phone": "012345678901", }, "description": "Welcome to Shady Meadows, a delightful Bed & Breakfast nestled in the hills on Newingtonfordburyshire. A place so beautiful you will never want to leave. All our rooms have comfortable beds and we provide breakfast from the locally sourced supermarket. It is a delightful place.", - "logoUrl": "/images/rbp-logo.jpg", + "logoUrl": "https://automationintesting.online//images/room2.jpg", "map": Object { "latitude": 52.6351204, "longitude": 1.2733774, }, "name": "Shady Meadows B&B", 16 | expect(response.status()).toBe(200); 17 | const body = await response.json(); > 18 | expect(body).toEqual(defaultBodyShort); | ^ 19 | 20 | await validateJsonSchema("GET_branding", "branding", body); 21 | await validateAgainstSchema(body, "Branding", "branding"); at /home/runner/work/playwright-api-test-demo/playwright-api-test-demo/tests/branding/branding.spec.ts:18:18

Check failure on line 18 in tests/branding/branding.spec.ts

View workflow job for this annotation

GitHub Actions / playwright-automation-checks

[api-checks] › branding/branding.spec.ts:13:7 › branding/ GET requests @branding › GET website branding @happy

1) [api-checks] › branding/branding.spec.ts:13:7 › branding/ GET requests @Branding › GET website branding @happy Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(received).toEqual(expected) // deep equality - Expected - 1 + Received + 1 @@ -4,11 +4,11 @@ "email": "[email protected]", "name": "Shady Meadows B&B", "phone": "012345678901", }, "description": "Welcome to Shady Meadows, a delightful Bed & Breakfast nestled in the hills on Newingtonfordburyshire. A place so beautiful you will never want to leave. All our rooms have comfortable beds and we provide breakfast from the locally sourced supermarket. It is a delightful place.", - "logoUrl": "/images/rbp-logo.jpg", + "logoUrl": "https://automationintesting.online//images/room2.jpg", "map": Object { "latitude": 52.6351204, "longitude": 1.2733774, }, "name": "Shady Meadows B&B", 16 | expect(response.status()).toBe(200); 17 | const body = await response.json(); > 18 | expect(body).toEqual(defaultBodyShort); | ^ 19 | 20 | await validateJsonSchema("GET_branding", "branding", body); 21 | await validateAgainstSchema(body, "Branding", "branding"); at /home/runner/work/playwright-api-test-demo/playwright-api-test-demo/tests/branding/branding.spec.ts:18:18

await validateJsonSchema("GET_branding", "branding", body);
await validateAgainstSchema(body, "Branding", "branding");
Expand All @@ -35,10 +35,11 @@
});

test.afterEach(async ({ request }) => {
await request.put("branding/", {
const response = await request.put("branding/", {
headers: headers,
data: defaultBody,
});
expect(response.status()).toBe(202);
Comment on lines +38 to +42

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

Bruh, we got a spicy issue here! 🌶️ Looks like you misspelled status as a function in expect(response.status()).toBe(202);. It should be expect(response.status).toBe(202);. Gotta keep those syntax errors in check, fam!

- expect(response.status()).toBe(202);
+ expect(response.status).toBe(202);

});

test("PUT website branding", async ({ request }) => {
Expand Down
Loading