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

add e2e testing style guidelines #29

Merged
merged 3 commits into from
Feb 5, 2020

Conversation

marianna-exelate
Copy link
Contributor

@marianna-exelate marianna-exelate commented Jan 28, 2020

related to #11

Copy link
Contributor

@lidoravitan lidoravitan left a 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

Copy link
Contributor

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

Copy link
Contributor

@einatnielsen einatnielsen left a 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

})
```

- **Page Object**

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

agree

- **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

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.

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?

- **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

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?

import TestPageObject from './TestPageObject'
const testPageObject = new TestPageObject()

it('should search data correctly', () => {

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)

Copy link
Contributor Author

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

```

- **Page Object**
- Responsible to encapsulate technical details (like css selectors, data attributes, etc`) to access the elements of the tested application page

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed


- **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`

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@marianna-exelate marianna-exelate merged commit b43bb5e into master Feb 5, 2020
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.

5 participants