Details
-
Umbrella
-
Status: Closed (View Workflow)
-
P3
-
Resolution: Won't Do
-
None
-
None
-
customfield_11100 21526
-
Core: Platform
Description
**Note: We should selectively update a couple modules and verify results before rolling this out to all.**
Update nightmare tests in ui-modules and platforms to use the pattern outlined in ui-users. This change will allow for enabling of code coverage enabled by UITEST-39 and demonstrated in UIU-570.
The main change is to accept a Nightmare object instantiated outside of the test, rather than creating a new one within each test.
For example, from this:
module.exports.test = function myTests(uiTestCtx) { describe('Example', function () { const nightmare = new Nightmare(config.nightmare); nightmare.foo() //... } }
To this:
module.exports.test = function myTests(uiTestCtx, nightmare) { describe('Example', function () { nightmare.foo() //... } }
Also remove any direct calls to .end() on the Nightmare instance within tests. End will be called on the shared instance after all tests are run. This includes use of the logout() helper method which internally calls end. A new helper method, logoutWithoutEnd() has been created to accommodate the transition.
Example, from this:
const { helpers: { login, logout } } = uiTestCtx; //... after( function (done) { logout(nightmare, config, done); });
To this:
const { helpers: { login, logoutWithoutEnd } } = uiTestCtx; //... after( function (done) { logoutWithoutEnd(nightmare, config, done); });
Finally, although not required, this may be a good opportunity to review and replace our use of arrow functions for the Mocha test scaffolding (describe, it, before, after, etc). Due to the lexically bound this of the arrow function, access to Mohca's context is blocked and therefore not recommended.
For example, rather than this:
it('should do something', (done) => { // ... }
Do this:
it('should do something', function (done) { // ... }
TestRail: Results
Attachments
Issue Links
- relates to
-
FOLIO-1619 Update platform-core nightmare tests to support coverage
-
- Closed
-
-
FOLIO-1620 Update ui-audit nightmare tests to support coverage
-
- Closed
-
-
STCLI-118 Update reference ui-module nightmare tests to support coverage
-
- Closed
-
-
UICHKOUT-474 Update ui-checkout nightmare tests to support coverage
-
- Closed
-
-
UICIRC-111 Update ui-circulation nightmare tests to support coverage
-
- Closed
-
-
UIIN-392 Update ui-inventory nightmare tests to support coverage
-
- Closed
-
-
UIREQ-169 Update ui-requests nightmare tests to support coverage
-
- Closed
-
-
UISE-92 Update ui-search nightmare tests to support coverage
-
- Closed
-
-
UITEN-25 Update ui-organization nightmare tests to support coverage
-
- Closed
-
-
FOLIO-1602 Enable coverage reporting on UI nightmare tests
-
- Closed
-
-
FOLIO-1660 platform-core tests fail as a suite
-
- Closed
-
-
UITEST-39 Add coverage functionality to stripes-testing method
-
- Closed
-
-
UIU-777 integration tests fail when run as a suite
-
- Closed
-