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

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

miguelvaara
Copy link
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)

Copy link

sonarcloud bot commented Nov 23, 2023

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

Copy link

codecov bot commented Nov 23, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (82873ab) 70.54% compared to head (11e619c) 70.54%.

Additional details and impacted files
@@             Coverage Diff              @@
##             skosmos-3    #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.

Copy link
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
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"?

@@ -1,42 +1,134 @@
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
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
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.

None yet

2 participants