-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(bdd smoke testing): introduce multi-user playwright bdd tests
ocis and oc10 bdd smoke tests are now able to with playwright and in parallel, this means running tests with many users at the same time are now possible. Sessions won't conflict, this introduces a whole new level of test possibilities and speed
- Loading branch information
Showing
55 changed files
with
1,719 additions
and
173 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module.exports = { | ||
smoke: ` | ||
--require ./tests/smoke/**/*.ts | ||
--require-module ts-node/register | ||
--format @cucumber/pretty-formatter | ||
--publish-quiet | ||
--format-options ${JSON.stringify({ | ||
snippetInterface: 'async-await', | ||
snippetSyntax: './tests/smoke/support/cucumber/snippets-syntax.js' | ||
})} | ||
` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
# WEB-Smoke-Tests (EXPERIMENTAL POC) | ||
|
||
Use with care, the smoke-test package introduces many new concepts and is still under heavy development. | ||
|
||
## Why smoke tests | ||
|
||
Before we release a new web version, we always take care that nothing breaks and the core features are working as | ||
expected. Till now this was a manual process which consumed a lot of time and effort. | ||
|
||
Manual steps are error-prone by nature, on the one hand they can bring up unknown issues, but on the other it's easy to | ||
forget some test steps. The main problem we faced, was that it's never a good thing to manually test your own code. | ||
|
||
To get closer to the point where we are able to release faster and more often, we started to develop the WEB-Smoke-Tests | ||
package. | ||
|
||
## Why not as part of the tests/acceptance package | ||
|
||
The tests/acceptance package has a much broader test scope and is here to test every little element // interaction in | ||
ci. To guarantee that process, a lot of steps are required which takes a lot of time and isn't the perfect fit for local | ||
development. | ||
|
||
The WEB-Smoke-Tests are much smaller and are still in an early phase. Many things are still not there compared to the | ||
mature tests/acceptance package. | ||
|
||
**The main reasons why we decided to split out the smoke tests are:** | ||
|
||
* we wanted to test on a persona // use-case level | ||
* testing should be easy, fast and reliable | ||
* no external dependencies expect a backend | ||
* strongly typed page-objects, steps and helpers | ||
* develop, test manually, extend automatic tests, release, repeat | ||
|
||
## Run a smoke test | ||
|
||
Please make sure to point http://host.docker.internal/ to 127.0.0.1 by adding it to your hosts. | ||
|
||
```shell | ||
$ yarn && yarn build:w | ||
$ docker-compose up oc10 ocis | ||
$ yarn test:smoke:experimental tests/smoke/features/kindergarten.feature | ||
``` | ||
|
||
## Available options | ||
|
||
To run the tests with below options, you have to set them as environment variable in you shell. | ||
|
||
```shell | ||
$ OPTION_1=foo OPTION_2=bar yarn test:smoke:experimental ... | ||
``` | ||
|
||
* **OCIS=boolean** | ||
* defines if the tests should use ocis as backend | ||
* **default**: false | ||
* **SLOW_MO=time-in-ms** | ||
* run the tests with a timeout between every interaction | ||
* **default**: 0 | ||
* **HEADLESS=boolean** | ||
* run the tests without opening a browser | ||
* **default**: false | ||
* **BROWSER=string** | ||
* define which browser is used to run the tests | ||
* **default**: chrome | ||
* **values**: firefox | webkit | chrome | chromium | ||
|
||
## Package structure | ||
|
||
This package is still in an early stage, design could change over time. | ||
|
||
### Features | ||
`./tests/smoke/features` | ||
[Gherkin features](https://cucumber.io/docs/gherkin/reference/) and corresponding [Cucumber step definitions](https://cucumber.io/docs/cucumber/step-definitions/) placed in there, it follows | ||
|
||
### Support | ||
`./tests/smoke/support` | ||
everything that is needed to run the tests organize as package | ||
|
||
`./tests/smoke/support/api` | ||
Every call that is used to provision, configure or even request data from backend will be placed here | ||
|
||
`./tests/smoke/support/cta` | ||
(Call to action) - Snippets that can be used across the entire livecycle of a test | ||
|
||
`./tests/smoke/support/cucumber` | ||
Mainly all cucumber related things, for now only setup is done here | ||
|
||
`./tests/smoke/support/page` | ||
With the option in mind that the smoke-test package could grow, we decided to already group interactions inside page | ||
objects. To get more background what page objects are, you can read | ||
the [introduction here](https://playwright.dev/docs/pom/) | ||
|
||
`./tests/smoke/support/store` | ||
Simple store to persist data for the lifetime of a test | ||
|
||
`./tests/smoke/support/world` | ||
Custom world that is used across the tests, global objects like services get initialized there. [Read more](https://github.com/cucumber/cucumber-js/blob/main/docs/support_files/world.md) | ||
|
||
## Packages we use | ||
|
||
* [cucumber-js](https://github.com/cucumber/cucumber-js) | ||
* [playwright](https://github.com/microsoft/playwright) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
Feature: Kindergarten can use web to organize a day | ||
|
||
As a kindergarten operator named Alice | ||
I want to manage all file related operations by using ownCloud WEB | ||
So that i'm sure all parents are informed and have the latest information in a easy and secure way | ||
|
||
Background: | ||
Given following users have been created | ||
| Alice | | ||
| Brian | | ||
| Carol | | ||
|
||
Scenario: Alice can share this weeks meal plan with all parents | ||
Given "Alice" has logged in | ||
Then "Alice" opens the "files" app | ||
Then "Alice" navigates to the files page | ||
Then "Alice" creates following folders | ||
| groups/Kindergarten Koalas/meal plan | | ||
| groups/Pre-Schools Pirates/meal plan | | ||
| groups/Teddy Bear Daycare/meal plan | | ||
And "Alice" uploads following resources | ||
| resource | to | | ||
| PARENT/parent.txt | groups/Kindergarten Koalas/meal plan | | ||
| lorem.txt | groups/Kindergarten Koalas/meal plan | | ||
| lorem-big.txt | groups/Kindergarten Koalas/meal plan | | ||
| data.zip | groups/Pre-Schools Pirates/meal plan | | ||
| lorem.txt | groups/Pre-Schools Pirates/meal plan | | ||
| lorem-big.txt | groups/Pre-Schools Pirates/meal plan | | ||
| data.zip | groups/Teddy Bear Daycare/meal plan | | ||
| lorem.txt | groups/Teddy Bear Daycare/meal plan | | ||
| lorem-big.txt | groups/Teddy Bear Daycare/meal plan | | ||
Then "Alice" shares following resources | ||
| resource | user | | ||
| groups/Pre-Schools Pirates/meal plan | Brian | | ||
| groups/Pre-Schools Pirates/meal plan | Carol | | ||
Given "Brian" has logged in | ||
Then "Brian" opens the "files" app | ||
Then "Brian" navigates to the shared with me page | ||
Then "Brian" downloads following files | ||
| resource | from | | ||
| data.zip | meal plan | | ||
Given "Carol" has logged in | ||
Then "Carol" opens the "files" app | ||
Then "Carol" navigates to the shared with me page | ||
Then "Carol" downloads following files | ||
| resource | from | | ||
| data.zip | meal plan | | ||
| lorem.txt | meal plan | | ||
| lorem-big.txt | meal plan | | ||
Then "Carol" has logged out | ||
Then "Brian" downloads following files | ||
| resource | from | | ||
| lorem.txt | meal plan | | ||
| lorem-big.txt | meal plan | | ||
Then "Brian" has logged out | ||
Then "Alice" downloads following files | ||
| resource | from | | ||
| parent.txt | groups/Kindergarten Koalas/meal plan | | ||
| lorem.txt | groups/Kindergarten Koalas/meal plan | | ||
| lorem-big.txt | groups/Kindergarten Koalas/meal plan | | ||
| data.zip | groups/Pre-Schools Pirates/meal plan | | ||
| lorem.txt | groups/Pre-Schools Pirates/meal plan | | ||
| lorem-big.txt | groups/Pre-Schools Pirates/meal plan | | ||
| data.zip | groups/Teddy Bear Daycare/meal plan | | ||
| lorem.txt | groups/Teddy Bear Daycare/meal plan | | ||
| lorem-big.txt | groups/Teddy Bear Daycare/meal plan | | ||
Then "Alice" has logged out | ||
|
Oops, something went wrong.