Conversation
somehow the firefox e2e test errors and I'm currently a bit clueless why |
now there seems to be a problem with typescript in the CI a tutorial how to use typescript with cypress (maybe we need a webpack config) https://glebbahmutov.com/blog/use-typescript-with-cypress/ |
"privacy": "https://example.com/privacy", | ||
"termsOfUse": "https://example.com/termsOfUse", | ||
"imprint": "https://example.com/imprint" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be removed again, but then again it's not really necessary since it's mock data anyway
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that you need most of the ids. Especially because I can use the same id multiple times (even if I shouldn't). E.g. For the external links: why don't you get all a tags in the footer and check how many with the wanted urls are present?
pull_request: | ||
branches: [master] | ||
|
||
jobs: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like both jobs are the same, but the browser. How about the matrix strategy, like we used in the build job?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can I use the matrix parameters just in with
statements?
Or should this also work?
end2end:
runs-on: ubuntu-latest
strategy:
matrix:
browser: ['e2e:chrome', 'e2e:firefox']
name: e2e Test Chrome
steps:
...
- name: Run cypress tests
run: yarn ${{ matrix.browser }}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can use it everywhere, where you want to insert a value. (please remember changing the job names, too)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
cypress/integration/banner.spec.ts
Outdated
expect(localStorage.getItem('bannerTimeStamp')).to.be.null | ||
}) | ||
|
||
it('text correct', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If cypress handles the test cases like other frameworks, then the content should be written like if you want to complete a sentence. In this case it would be "shows the correct alert banner text"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed some of the descriptions
cypress/integration/banner.spec.ts
Outdated
|
||
it('text dismissable', () => { | ||
cy.get('.alert-primary.show').contains(banner.text) | ||
cy.get('.alert-primary.show').find('.fa-times').click().then(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use multiple lines, if you have builder-pattern-like chains
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed that
@@ -15,15 +15,15 @@ export const PoweredByLinks: React.FC = () => { | |||
return ( | |||
<p> | |||
<Trans i18nKey="landing.footer.poweredBy"> | |||
<ExternalLink href="https://codimd.org" text="CodiMD"/> | |||
<ExternalLink href="https://codimd.org" text="CodiMD" id='codimd'/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is a good id, because it's too general. Why do you need an id? Can't you do a query for a link that points to this url? Like a[href=https://CodiMD.org]
. See css attribute selector.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed that
b0af5c6
to
ecd8609
Compare
Component/Part
E2E Tests
Description
This PR adds E2E Tests.
Steps
Related Issue(s)
#11