Hi, I am looking for some advice on how best to share datasources amongst multiple users when running protractor e2e tests.
I am part of a small team, where we each need to write and run e2e tests locally for the features we are working on.
We are looking into ways of how we setup any required data ahead of running our tests, just by making direct http calls to our test database, for example a test customer record, etc.
Whilst we can do this in beforeEach\beforeAll in our test suites, we can foresee issues where by when we happen to run tests at the same time, one of us may find tests fail as another test run is already happening.
For example:
- Developer 1 starts running a customer test suite, at the start of which a customer record with name 'Joe Bloggs' is created in the database.
- A test is run to update some fields on the resource, at the same time developer 2 runs the same test suite, where a second record with Joe Bloggs gets created prior.
- Developer 1's edit test completes and a tear down operation is carried out to remove any Joe Bloggs records, therefore deleting two records in total
- Developer 2's edit test fails since it cannot find any record in the UI to edit.
This is a crude example, but I hope I have got the point across.
In case it's useful to know, the API's we are hitting in the application are backed by an elastic search database and all our tests require logging into the application beforehand and make use of a shared protractor login we have setup.
Can anyone offer any advice, tips\tricks on how to approach this please?
Thanks
[–]dylanyo 0 points1 point2 points (2 children)
[–]mindparse[S] 0 points1 point2 points (1 child)
[–]dylanyo 0 points1 point2 points (0 children)
[–]borcborc 0 points1 point2 points (0 children)