Related T1768
Add e2e tests for file/content view.
Details
- Reviewers
anlambert - Group Reviewers
Reviewers - Commits
- rDWAPPS70b14f0ad300: Add tests for content display
Diff Detail
- Repository
- rDWAPPS Web applications
- Branch
- fileTest
- Lint
No Linters Available - Unit
No Unit Test Coverage - Build Status
Buildable 6586 Build 9185: tox-on-jenkins Jenkins Build 9184: arc lint + arc unit
Event Timeline
Build is green
See https://jenkins.softwareheritage.org/job/DWAPPS/job/tox/541/ for more details.
Looks good so far. I added some inline comments to improve some points of implementation.
cypress/integration/content-view.spec.js | ||
---|---|---|
9 ↗ | (On Diff #5514) | It would be great if you could compute the number of lines dynamically instead of harcoding it. The easiest way will be to query the browse/origin/raw endpoint (you already computed this url in your last test implementation) in the before hook of the tests and then count the number of lines. |
30 ↗ | (On Diff #5514) | Can you add a CSS class swh-content-filename to the card header in the templates/includes/content-display.html file and use it to select the filename element instead ? This way, if one day we migrate away from using bootstrap, we won't need to modify this test implementation. |
51 ↗ | (On Diff #5514) | Can you also test that the links to all sub-directories in the breadcrumbs are also present ? |
57 ↗ | (On Diff #5514) | Here I would rather use the following selector a[href="${rawFilePath}]" in order to ensure the test will still pass if we move the Raw File button elsewhere in the layout. |
I tried calculating number of lines dynamically but the number of lines displayed are 93 and response.body.split('\n').length gives me 94.
Build is green
See https://jenkins.softwareheritage.org/job/DWAPPS/job/tox/543/ for more details.
It looks like highlightjs will not render the last line of a source file if it is empty. You should check if the last element in the split array is the empty string and decrement the number of computed lines if it is the case.
Build is green
See https://jenkins.softwareheritage.org/job/DWAPPS/job/tox/547/ for more details.
Build is green
See https://jenkins.softwareheritage.org/job/DWAPPS/job/tox/556/ for more details.
Build is green
See https://jenkins.softwareheritage.org/job/DWAPPS/job/tox/557/ for more details.
Build is green
See https://jenkins.softwareheritage.org/job/DWAPPS/job/tox/564/ for more details.