Skip to content

Issue1476: cypress tests for vocab home page tempate statistics#1564

Open
miguelvaara wants to merge 6 commits intomainfrom
issue1476-cypress-tests-for-vocab-home-page-tempate-statistics-updated
Open

Issue1476: cypress tests for vocab home page tempate statistics#1564
miguelvaara wants to merge 6 commits intomainfrom
issue1476-cypress-tests-for-vocab-home-page-tempate-statistics-updated

Conversation

@miguelvaara
Copy link
Copy Markdown
Contributor

@miguelvaara miguelvaara commented Nov 23, 2023

Reasons for creating this PR

The tests for the vocabulary homepage are part of making sure users have a good experience. Run the tests following the usual Cypress testing process

Link to relevant issue(s), if any

Description of the changes in this PR

In addition to the previously written tests, we are now testing both tables on the vocabulary homepage:
"Resource counts by type"
"Term counts by language"

Known problems or uncertainties in this PR

Due to the issues mentioned in this issue, the previously created tests regarding the alphabetical list are failing inconsistently

Checklist

  • phpUnit tests pass locally with my changes
  • I have added tests that show that the new code works, or tests are not relevant for this PR (e.g. only HTML/CSS changes)
  • The PR doesn't reduce accessibility of the front-end code (e.g. tab focus, scaling to different resolutions, use of .sr-only class, color contrast)
  • The PR doesn't introduce unintended code changes (e.g. empty lines or useless reindentation)

@miguelvaara miguelvaara requested a review from osma November 23, 2023 15:39
@sonarqubecloud
Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@codecov
Copy link
Copy Markdown

codecov Bot commented Nov 23, 2023

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.54%. Comparing base (82873ab) to head (11e619c).
⚠️ Report is 1069 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #1564   +/-   ##
=========================================
  Coverage     70.54%   70.54%           
  Complexity     1644     1644           
=========================================
  Files            32       32           
  Lines          4315     4315           
=========================================
  Hits           3044     3044           
  Misses         1271     1271           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Member

@osma osma left a comment

Choose a reason for hiding this comment

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

Looks good in general, I gave a few minor suggestions for improvements. After considering those, this can be merged.


// click on the second letter (C)
cy.get('#tab-alphabetical .pagination :nth-child(2) > .page-link').click()
// Click on the second letter (D)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Shouldn't this be "fourth letter"?

describe('Vocabulary home page', () => {
it('contains vocabulary title', () => {
cy.visit('/test/en') // go to the "Test ontology" home page
cy.visit('/yso/en') // Go to the "YSO - General Finnish ontology (archaeology)" home page
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The URL should be /yso/en/ with the final slash included. (This was also wrong in the previous version)
The URL without the final slash will work, but there is an extra redirect because it's not the "canonical" URL of the vocabulary home page.

})
it('shows alphabetical index letters', () => {
cy.visit('/test/en') // go to the "Test ontology" home page
cy.visit('/yso/en') // Go to the "YSO - General Finnish ontology (archaeology)" home page
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same URL issue here, and below a few more times

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.

Cypress tests for vocab-home page tempate (statistics)

2 participants