Bug #41349
closedmgr/dashboard: Improve stability of navigating pages with tables in E2E tests
0%
Description
While migrating the E2E tests to async/await, I came across a bug that's not always reproducible. It depends on how fast an asynchronous request is returned from the backend.
In detail, it's about the RGW Daemons page. An E2E test is navigating to the page and reading a value, comparing it with some other value previously fetched. That value (amount of deamons at the bottom of the table) is 0 when the table didn't load fast enough. The problem can be fixed by adapting the test to wait for the table to have finished loading.
Expected 'Object Gateways 1 total' to contain '0 total'. Expected :"0 total" Actual :"Object Gateways\n1 total" <Click to see difference> Error: Failed expectation at Object.<anonymous> (/home/user/src/ceph-1/src/pybind/mgr/dashboard/frontend/e2e/dashboard.e2e-spec.ts:125:25) at step (/home/user/src/ceph-1/src/pybind/mgr/dashboard/frontend/node_modules/tslib/tslib.js:133:27) at Object.next (/home/user/src/ceph-1/src/pybind/mgr/dashboard/frontend/node_modules/tslib/tslib.js:114:57) at fulfilled (/home/user/src/ceph-1/src/pybind/mgr/dashboard/frontend/node_modules/tslib/tslib.js:104:62) at process._tickCallback (internal/process/next_tick.js:68:7)
But to improve the overall stability of the tests, it makes sense to check if the page to be navigated to contains a table and if so, waits for that table to finish loading (as a user would do, too). This prevents failing tests of that kind in the whole E2E project, including currently undetected ones, tests that are prone to that kind of error and would appear as soon as a response takes longer than expected and also all tests that will be written. The developers would simply don't have to take care about that anymore and could safely assume, that `navigateTo()` will wait for the page to be completely loaded.
Updated by Patrick Seidensal over 4 years ago
- Related to Bug #40693: mgr/dashboard: Switch to async/await for E2E tests added
Updated by Patrick Seidensal over 4 years ago
- Status changed from In Progress to Fix Under Review
Updated by Patrick Seidensal over 4 years ago
- Status changed from Fix Under Review to Resolved
Updated by Ernesto Puerta about 3 years ago
- Project changed from mgr to Dashboard
- Category changed from 151 to Testing & QA