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

Fix: Integration and enable back accessibility tests #2458

Merged
merged 9 commits into from
Sep 26, 2024

Conversation

hellofanny
Copy link
Contributor

@hellofanny hellofanny commented Sep 13, 2024

What's the purpose of this pull request?

  • Updates pdp product link for tests and updates tests to adapt to new product
image

The product we were testing is OutOfStock and does not have the expected ID. We switched to another product and updated the other tests accordingly."

  • Puts back cy.checkA11y for home page, collection page and product page. (a11y.test.js)
    • Fix automatic accessibility issues & improves overall

How it works?

This PR, should fix the failing tests below:

image image image

How to test it?

  1. You can test using this PR, the integration test all should be passing.
image
  1. Run the core locally, then run yarn test. All the tests should pass.

Starters Deploy Preview

vtex-sites/starter.store#535

References

https://dequeuniversity.com/rules/axe/4.10/region?application=AxeChrome

Copy link

vercel bot commented Sep 13, 2024

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

Name Status Preview Comments Updated (UTC)
faststore-site ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 26, 2024 1:28am

@hellofanny hellofanny changed the title Fix/intergration tests fix: Integration tests Sep 13, 2024
Copy link

codesandbox-ci bot commented Sep 13, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@hellofanny hellofanny changed the title fix: Integration tests fix: Integration and enable back accessibility tests Sep 16, 2024
".next/**"
]
"dependsOn": ["^build"],
"env": ["BASE_SITE_URL"],
Copy link
Contributor Author

Choose a reason for hiding this comment

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

{...otherProps}
>
{!!title && <div data-fs-payment-methods-title>{title}</div>}
{!!title && (
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the future, I think we can remove it, and make title always required.

return (
<Section className={`${styles.section} section-incentives layout__section`}>
<UIIncentives incentives={incentives} colored />
<UIIncentives incentives={incentives} colored label={label ?? ''} />
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Leaving it as an empty string isn’t ideal, but it works for now. Ideally, we should receive a label from the CMS (if applicable) to identify which Incentive section we’re referring to. 😞

The issue occurs when we have more than one Incentive section on the same page, as we currently lack a label reference to differentiate between them (this is the case on the homepage).

Screenshot 2024-09-16 at 11 55 49

@@ -22,11 +22,14 @@ const lhConfig = ({ urls, server, assertions = {} }: Params) => {
assert: {
preset: 'lighthouse:no-pwa',
assertions: {
// Final Ligthouse score Budgets
// Final Lighthouse score Budgets
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll move this to another PR.

Page is blocked from indexing when is in preview. So I think we can set it as a warn when not in production.

@hellofanny hellofanny self-assigned this Sep 16, 2024
@hellofanny hellofanny added bug Something isn't working enhancement New feature or request labels Sep 16, 2024
expect($link.attr('href')).to.eq(`${storeUrl}${pages.pdp}`)
.and(($link) => {
const href = $link.attr('href')
const regex = new RegExp(`^${href.split('/')[0]}`)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did this because I don't have access the product sku to compare and need to validate if "4k-monitor-99988213/p" contains "4k-monitor"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually I can just add 99988213 manually 😬

@hellofanny hellofanny marked this pull request as ready for review September 23, 2024 21:48
@hellofanny hellofanny requested a review from a team as a code owner September 23, 2024 21:48
@hellofanny hellofanny requested review from lariciamota and pedromtec and removed request for a team September 23, 2024 21:48
Copy link
Member

@eduardoformiga eduardoformiga left a comment

Choose a reason for hiding this comment

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

LGTM! ⭐

'categories:accessibility': ['error', { minScore: 1 }],
'categories:best-practices': ['error', { minScore: 1 }],
'categories:performance': ['error', { minScore: 0.95 }],
'categories:seo': ['error', { minScore: 1 }],
'categories:seo':
process.env.NODE_ENV !== 'production'
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure if the preview environment is treated as production or another one.

@hellofanny hellofanny changed the title fix: Integration and enable back accessibility tests Fix: Integration and enable back accessibility tests Sep 26, 2024
@hellofanny hellofanny merged commit 2d6d89e into main Sep 26, 2024
7 checks passed
@hellofanny hellofanny deleted the fix/intergration-tests branch September 26, 2024 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants