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

tests: cy howto read flaky #3861

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
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
34 changes: 16 additions & 18 deletions packages/cypress/src/integration/howto/read.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ describe('[How To]', () => {

beforeEach(() => {
cy.visit('/how-to')
// Hack to get the tags store to finish populating before the expectations
cy.wait(1000)
Comment on lines -53 to -54
Copy link
Member

Choose a reason for hiding this comment

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

I'd be very suprised if removing this helps. If anything it probably needs time added to it.

})

describe('[By Everyone]', () => {
Expand All @@ -63,24 +61,24 @@ describe('[How To]', () => {

cy.step('How-to has basic info')
cy.title().should('eq', `${howto.title} - How-to - Community Platform`)
cy.get('[data-cy=how-to-basis]').then(($summary) => {
expect($summary).to.contain('howto_creator', 'Author')
expect($summary).to.contain('Last update', 'Edit')
expect($summary).to.contain('Make an interlocking brick', 'Title')
expect($summary).to.contain(

cy.get('[data-cy=how-to-basis]').as('summary')

cy.get('@summary').within(() => {
cy.contains('howto_creator')
cy.contains('Last update')
cy.contains('Make an interlocking brick')
cy.contains(
'show you how to make a brick using the injection machine',
'Description',
)
expect($summary).to.contain('3-4 weeks', 'Duration')
expect($summary).to.contain(DifficultyLevel.HARD, 'Difficulty')
expect($summary).to.contain('product', 'Tag')
expect($summary).to.contain('injection', 'Tag')
expect($summary.find('img[alt="how-to cover"]'))
.to.have.attr('src')
.match(coverFileRegex)
expect($summary.find('[data-cy=file-download-counter]')).to.contain(
'1,234 downloads',
)
cy.contains('3-4 weeks')
cy.contains(DifficultyLevel.HARD)
cy.contains('product')
cy.contains('injection')
cy.get('img[alt="how-to cover"]')
.should('have.attr', 'src')
.and('match', coverFileRegex)
cy.get('[data-cy=file-download-counter]').contains('1,234 downloads')
})

cy.step('Breadcrumbs work')
Expand Down
Loading