diff options
author | Željko Filipin <zeljko.filipin@gmail.com> | 2024-09-16 12:22:51 +0200 |
---|---|---|
committer | Željko Filipin <zeljko.filipin@gmail.com> | 2024-09-19 10:57:35 +0200 |
commit | e5ce705de7253ecfc23a1a019c7e376d77ec3b58 (patch) | |
tree | f16ad10de2a262094891b6696f502a0fedea46d6 /tests/selenium/docs/Stack | |
parent | 5d95b85c16ad391bdfac78eecbccb2b92ca154f4 (diff) | |
download | mediawikicore-e5ce705de7253ecfc23a1a019c7e376d77ec3b58.tar.gz mediawikicore-e5ce705de7253ecfc23a1a019c7e376d77ec3b58.zip |
selenium: Replace Node.js Assert library with WebdriverIO Expect library
Assertions from Expect library are more readable that assertions from Assert library.
Bug: T325740
Change-Id: I686f39d7ef08085037bc34219c6f55eba9da8dd1
Diffstat (limited to 'tests/selenium/docs/Stack')
-rw-r--r-- | tests/selenium/docs/Stack/specs/expect.js (renamed from tests/selenium/docs/Stack/specs/assert.js) | 7 | ||||
-rw-r--r-- | tests/selenium/docs/Stack/specs/pageobject.js | 3 |
2 files changed, 3 insertions, 7 deletions
diff --git a/tests/selenium/docs/Stack/specs/assert.js b/tests/selenium/docs/Stack/specs/expect.js index e29c8504ce6e..12f22e4257e6 100644 --- a/tests/selenium/docs/Stack/specs/assert.js +++ b/tests/selenium/docs/Stack/specs/expect.js @@ -9,12 +9,9 @@ // const baseUrl = 'http://localhost:8080/wiki/'; const baseUrl = `${ process.env.MW_SERVER }${ process.env.MW_SCRIPT_PATH }/index.php?title=`; -const assert = require( 'assert' ); - describe( 'Main page', () => { - it( 'should have "Log in" link when using assert', async () => { + it( 'should have "Log in" link when using expect', async () => { await browser.url( `${ baseUrl }Main_Page` ); - const displayed = await $( 'li#pt-login-2 a' ).isDisplayed(); - assert( displayed ); + await expect( await $( 'li#pt-login-2 a' ) ).toExist(); } ); } ); diff --git a/tests/selenium/docs/Stack/specs/pageobject.js b/tests/selenium/docs/Stack/specs/pageobject.js index bd6e65be7067..1c99a06987b2 100644 --- a/tests/selenium/docs/Stack/specs/pageobject.js +++ b/tests/selenium/docs/Stack/specs/pageobject.js @@ -3,12 +3,11 @@ 'use strict'; -const assert = require( 'assert' ); const MainPage = require( '../pageobjects/main.page' ); describe( 'Main Page', () => { it( 'should have "Log in" link when using page object', async () => { await MainPage.open(); - assert( await MainPage.login.isDisplayed() ); + await expect( MainPage.login ).toExist(); } ); } ); |