-
Notifications
You must be signed in to change notification settings - Fork 7
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
add e2e testing style guidelines #29
Conversation
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.
LGTM :)
- Common reusable logic that can be shared between tests (i.e login flow) | ||
- Uses one or more Page Objects under the hood | ||
- Has no assertions | ||
|
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 think it might be good to give an example of Flow
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.
Looks great!!! added some small comments
javascript/testing/README.md
Outdated
}) | ||
``` | ||
|
||
- **Page Object** |
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 think we can give a link for some article about Page Objects, for example, https://martinfowler.com/bliki/PageObject.html
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.
agree
javascript/testing/README.md
Outdated
- **Test** | ||
- Uses the [AAA pattern](#aaa-pattern---arrange-act-assert) | ||
- One and only one unit that __has assertions__ for testing components' integration and data integrity | ||
- Uses one or more `Page Objects` to access and interact with tested application page |
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.
Uses one or more Flows to implement "act" part of the test.
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.
Maybe we should start with PageObject, then Flow and only then with Test, which uses Page Object and Flow?
javascript/testing/README.md
Outdated
- **Test** | ||
- Uses the [AAA pattern](#aaa-pattern---arrange-act-assert) | ||
- One and only one unit that __has assertions__ for testing components' integration and data integrity | ||
- Uses one or more `Page Objects` to access and interact with tested application page |
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.
Maybe we should start with PageObject, then Flow and only then with Test, which uses Page Object and Flow?
javascript/testing/README.md
Outdated
import TestPageObject from './TestPageObject' | ||
const testPageObject = new TestPageObject() | ||
|
||
it('should search data correctly', () => { |
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 think that in this test we are actually checking that searchTerm was displayed and not that data was searched correctly.
Or we need to change the assertion (which should check that there are corrected filtered elements) or change the title of the test (which I prefer more because don't want to make an example more complicated)
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 think that it checks filter by search term functionality, since the last assertion is getSearchResults().should('contain', 'searchTerm') - that checks search functionality
javascript/testing/README.md
Outdated
``` | ||
|
||
- **Page Object** | ||
- Responsible to encapsulate technical details (like css selectors, data attributes, etc`) to access the elements of the tested application page |
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.
"to access and manipulate", otherwise it seems that Page Object should be only getter specific
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
javascript/testing/README.md
Outdated
|
||
- **Page Object** | ||
- Responsible to encapsulate technical details (like css selectors, data attributes, etc`) to access the elements of the tested application page | ||
- Provides an atomic API for interaction with tested application page. This API is used by `Test` |
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.
"Provides an API for atomic interactions with the tested application page" - I think that the operation should be atomic and not API
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
related to #11