This section contains end-to-end (e2e) tests related utilities. These tests have been included to simulate a real user scenarios to test the application.
Refer to the WikiLambda set-up docs.
Browsers: Ensure to have Chrome / Chromium installed on your computer.
Environment variables: The MW_SERVER
and MW_SCRIPT_PATH
env variables are required. You may just source the .env
file from the root of your mediawiki installation as below:
source /path/to/mediawiki/.env
Run all the commands from the root of the WikiLambda.
Run all the tests once using the following command:
npm run browser-test
Run specific test once using the following command:
Filter by file name:
npm run browser-test -- --spec tests/selenium/specs/[FILE-NAME]
Filter by file name and test name:
npm run browser-test -- --spec tests/selenium/specs/[FILE-NAME] --mochaOpts.grep [TEST-NAME]
Run all the tests multiple times (default 10 times) to check the stability of the tests using the following command:
npm run browser-stress-test:all
Customize the number of times each test should run using the following command:
npm run browser-stress-test:all -- --execution-number=[NUMBER-OF-TIMES]
Run specific test multiple times using the following command:
npm run browser-stress-test -- --target-file=[FILE-NAME] --execution-number=[NUMBER-OF-TIMES]
specs/
: Contains tests to be executed.
utils/
: Contains utility functions or helper modules that can be reused across the test suites.
ElementActions.js
: Contains general actions that are performed on the browser elements.i18n.js
: Contains action for retrieving English string names.wdio.conf.js
: Contains the configuration for the tests.
pageobjects/
: Contains specific page related selectors and actions.
Naming Convention: view mode:
<PageName>.page.js
edit mode:<PageName>Form.page.js
function/
: Contains selectors and actions for the Function page.implementation/
: Contains selectors and actions for the Implementation page.tester/
: Contains selectors and actions for the Tester page.special/
: Contains selectors and actions for the Special pages.componentobjects/
: Contains components that are shared across multiple pages of the application.
AboutBlock.js
: selectors and actions for the About block.ContentBlock.js
: selectors and actions for the Content block.EvaluateFunctionBlock.js
: selectors and actions for the Evaluate Function block.FunctionExplorerBlock.js
: selectors and actions for the Function Explorer block.InputDropdown.js
: selectors and actions for the Input Dropdown.ZObjectPublish.js
: selectors and actions for the ZObject Publish Flow.