Skip to content
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

Test Pages, Contact & Donation #1662

Open
wants to merge 8 commits into
base: dev
Choose a base branch
from
Open

Test Pages, Contact & Donation #1662

wants to merge 8 commits into from

Conversation

MustafaBudak41
Copy link

@MustafaBudak41 MustafaBudak41 commented Sep 10, 2024

Arts, Collections, Activities and About Us were tested on the Pages.spec.ts page.
Contact and Donate pages were tested on their own pages.
Note: When I did 'yarn format', it edited other pages. For this reason, there are many changes in Githup. The changes that belong to me are only on 3 pages.

Copy link

vercel bot commented Sep 10, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
dashboard ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 18, 2024 11:55pm
foundation ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 18, 2024 11:55pm
kunsthalte ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 18, 2024 11:55pm
trend-rights ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 18, 2024 11:55pm
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
lotus ⬜️ Ignored (Inspect) Visit Preview 💬 Add feedback Sep 18, 2024 11:55pm
wsvvui ⬜️ Ignored (Inspect) Visit Preview Sep 18, 2024 11:55pm

Copy link

alwaysmeticulous bot commented Sep 10, 2024

🤖 Meticulous replayed 50 user sessions and took 161 visual snapshots. Meticulous has not yet run on 1b472ec of the main branch and so there was nothing to compare against.
If you recently setup Meticulous, this is expected. Meticulous will start reporting comparisons for new pull requests after the next commit to the main branch.
If you are using Vercel, please make sure you have disabled automatic job cancellation as documented here.

Last updated for commit 94790b5. This comment will update as new commits are pushed.

Copy link
Sponsor Contributor

@7alip 7alip left a comment

Choose a reason for hiding this comment

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

Thanks
Could you split your test into separate test cases:

test.describe("...", () => {
  test("TC-01: ...", () => {})
   
  test("TC-02: ...", () => {})
})

packages/playwright/src/tests/07-pages.spec.ts Outdated Show resolved Hide resolved
packages/playwright/src/tests/07-pages.spec.ts Outdated Show resolved Hide resolved
packages/playwright/src/tests/07-pages.spec.ts Outdated Show resolved Hide resolved
packages/playwright/src/tests/07-pages.spec.ts Outdated Show resolved Hide resolved
expect(successDiv).toBe('Thank you. Your message has been delivered.') // 07. Can the user send the message successfully ?

const emaillink = page.locator('a[href^="mailto:"]')
await expect(emaillink).toHaveCount(1) // 08. When clicking on the email address icon, the user should be directed to the Outlook application.
Copy link
Sponsor Contributor

Choose a reason for hiding this comment

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

toHaveCount is intended to be used for list I think. toBeVisible would be better.


const inputLocator = page.locator('.chakra-numberinput input')
const valuee = await inputLocator.inputValue()
expect(valuee).toContain('10')
Copy link
Sponsor Contributor

Choose a reason for hiding this comment

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

Up to here, it could be separate test case:

test('TC-02: should display correct amount in input', ({ page }) => {})

await page.getByPlaceholder('E-mail').click()
await page.getByPlaceholder('Name').click()

const requiredTextName = await page.locator('text=name is a required field')
Copy link
Sponsor Contributor

Choose a reason for hiding this comment

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

It has error-text-name testid

expect(isValidEmail).toBe(true) // 07. Assert that the email is valid
await Promise.all([page.getByRole('button', { name: 'Donate €' }).click()])
const newUrl = page.url()
expect(isValidEmail).toBe(newUrl.length > 0) // 08. When the donate button is clicked, the user should be directed to the payment page.
Copy link
Sponsor Contributor

Choose a reason for hiding this comment

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

What about this?

 expect(newUrl).toContain('checkout.stripe.com')

Comment on lines 67 to 71
const emailValue = await emailInput.inputValue()
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/

const isValidEmail = emailRegex.test(emailValue)
expect(isValidEmail).toBe(true) // 07. Assert that the email is valid
Copy link
Sponsor Contributor

Choose a reason for hiding this comment

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

You don't need to validate emails like developers. You should just check if UI shows error message for invalid emails. I would remove this regex validation


const isValidEmail = emailRegex.test(emailValue)
expect(isValidEmail).toBe(true) // 07. Assert that the email is valid
await Promise.all([page.getByRole('button', { name: 'Donate €' }).click()])
Copy link
Sponsor Contributor

Choose a reason for hiding this comment

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

Promise.all shouldn't be needed here.

Suggested change
await Promise.all([page.getByRole('button', { name: 'Donate €' }).click()])
await page.getByRole('button', { name: 'Donate €' }).click()
await page.waitForLoadState('documentloaded')

@vercel vercel bot temporarily deployed to Preview – dashboard September 16, 2024 21:35 Inactive
@vercel vercel bot temporarily deployed to Preview – kunsthalte September 16, 2024 21:35 Inactive
@vercel vercel bot temporarily deployed to Preview – foundation September 16, 2024 21:35 Inactive
@vercel vercel bot temporarily deployed to Preview – trend-rights September 16, 2024 21:36 Inactive
@vercel vercel bot temporarily deployed to Preview – wsvvui September 16, 2024 21:36 Inactive
@vercel vercel bot temporarily deployed to Preview – lotus September 16, 2024 21:36 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants