Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wdio-mediawiki 2.4.0 - Remove Local Patches #494

Merged
merged 19 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 0 additions & 53 deletions test/helpers/WDIOMediawikiScreenshotPatch.js

This file was deleted.

47 changes: 0 additions & 47 deletions test/helpers/pages/SuiteLoginPage.js

This file was deleted.

32 changes: 0 additions & 32 deletions test/helpers/pages/WDIOMediawikiPagePatch.js

This file was deleted.

8 changes: 4 additions & 4 deletions test/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"stylelint-config-wikimedia": "0.16.1",
"ts-node": "^10.9.1",
"typescript": "^5.2.2",
"wdio-mediawiki": "^2.3.0",
"wdio-mediawiki": "2.4.0",
"wdio-wikibase": "^6.0.1"
},
"browserslist": [
Expand Down
4 changes: 2 additions & 2 deletions test/specs/repo/extensions/babel.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assert from 'assert';
import SuiteLoginPage from '../../../helpers/pages/SuiteLoginPage.js';
import LoginPage from 'wdio-mediawiki/LoginPage.js';
import { skipIfExtensionNotPresent } from '../../../helpers/default-functions.js';

describe( 'Babel', function () {
Expand All @@ -8,7 +8,7 @@ describe( 'Babel', function () {
} );

it( 'Should be able to update the user page with language skills', async () => {
await SuiteLoginPage.loginAdmin();
await LoginPage.login( process.env.MW_ADMIN_NAME, process.env.MW_ADMIN_PASS );

const executionContent = await browser.editPage(
process.env.MW_SERVER,
Expand Down
4 changes: 2 additions & 2 deletions test/specs/repo/extensions/nuke.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assert from 'assert';
import SuiteLoginPage from '../../../helpers/pages/SuiteLoginPage.js';
import LoginPage from 'wdio-mediawiki/LoginPage.js';
import { skipIfExtensionNotPresent } from '../../../helpers/default-functions.js';

describe( 'Nuke', function () {
Expand All @@ -23,7 +23,7 @@ describe( 'Nuke', function () {

assert.strictEqual( pageExistsResult.status, 200 );

await SuiteLoginPage.loginAdmin();
await LoginPage.login( process.env.MW_ADMIN_NAME, process.env.MW_ADMIN_PASS );
await browser.url( process.env.MW_SERVER + '/wiki/Special:Nuke' );

await $( 'button.oo-ui-inputWidget-input' ).click();
Expand Down
4 changes: 2 additions & 2 deletions test/specs/repo/extensions/wikibase-local-media.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assert from 'assert';
import SuiteLoginPage from '../../../helpers/pages/SuiteLoginPage.js';
import LoginPage from 'wdio-mediawiki/LoginPage.js';
import { skipIfExtensionNotPresent } from '../../../helpers/default-functions.js';
import WikibaseApi from 'wdio-wikibase/wikibase.api.js';

Expand All @@ -11,7 +11,7 @@ describe( 'WikibaseLocalMedia', function () {
} );

it( 'Should allow to upload an image', async () => {
await SuiteLoginPage.loginAdmin();
await LoginPage.login( process.env.MW_ADMIN_NAME, process.env.MW_ADMIN_PASS );

await browser.url( process.env.MW_SERVER + '/wiki/Special:Upload/' );

Expand Down
4 changes: 2 additions & 2 deletions test/specs/repo/queryservice.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import assert from 'assert';
import { stringify } from 'querystring';
import LoginPage from 'wdio-mediawiki/LoginPage.js';
import { getTestString } from 'wdio-mediawiki/Util.js';
import WikibaseApi from 'wdio-wikibase/wikibase.api.js';
import SuiteLoginPage from '../../helpers/pages/SuiteLoginPage.js';
import QueryServiceUI from '../../helpers/pages/queryservice-ui/queryservice-ui.page.js';

describe( 'QueryService', () => {
Expand Down Expand Up @@ -116,7 +116,7 @@ describe( 'QueryService', () => {
// TODO make an item using the UI
const itemId = await WikibaseApi.createItem( getTestString( 'T267743-' ) );

await SuiteLoginPage.loginAdmin();
await LoginPage.login( process.env.MW_ADMIN_NAME, process.env.MW_ADMIN_PASS );

// goto delete page
const query = { action: 'delete', title: 'Item:' + itemId };
Expand Down
4 changes: 2 additions & 2 deletions test/specs/repo_client/extensions/scribunto-item.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { getTestString } from 'wdio-mediawiki/Util.js';
import assert from 'assert';
import SuiteLoginPage from '../../../helpers/pages/SuiteLoginPage.js';
import LoginPage from 'wdio-mediawiki/LoginPage.js';
import { stringify } from 'querystring';
import { readFile } from 'fs/promises';
import { skipIfExtensionNotPresent } from '../../../helpers/default-functions.js';
Expand Down Expand Up @@ -71,7 +71,7 @@ describe( 'Scribunto Item', function () {

// This will generate a change that will dispatch
it( 'Should be able to delete the item on repo', async () => {
await SuiteLoginPage.loginAdmin();
await LoginPage.login( process.env.MW_ADMIN_NAME, process.env.MW_ADMIN_PASS );

// goto delete page
const query = { action: 'delete', title: 'Item:' + itemId };
Expand Down
4 changes: 2 additions & 2 deletions test/specs/repo_client/item.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import assert from 'assert';
import { stringify } from 'querystring';
import LoginPage from 'wdio-mediawiki/LoginPage.js';
import { getTestString } from 'wdio-mediawiki/Util.js';
import WikibaseApi from 'wdio-wikibase/wikibase.api.js';
import SuiteLoginPage from '../../helpers/pages/SuiteLoginPage.js';
import ExternalChange from '../../helpers/types/external-change.js';

const itemLabel = getTestString( 'The Item' );
Expand Down Expand Up @@ -105,7 +105,7 @@ describe( 'Item', function () {

// This will generate a change that will dispatch
it( 'Should be able to delete the item on repo', async () => {
await SuiteLoginPage.loginAdmin();
await LoginPage.login( process.env.MW_ADMIN_NAME, process.env.MW_ADMIN_PASS );

// goto delete page
const query = { action: 'delete', title: 'Item:' + itemId };
Expand Down
12 changes: 6 additions & 6 deletions test/wdio.conf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
* See also: http://webdriver.io/guide/testrunner/configurationfile.html
*/

import { Frameworks, Options } from '@wdio/types';
import { existsSync, mkdir, rm } from 'fs';
import JsonReporter from './helpers/json-reporter.js';
import { defaultFunctions as defaultFunctionsInit } from './helpers/default-functions.js';
import saveScreenshot from './helpers/WDIOMediawikiScreenshotPatch.js';
import { saveScreenshot } from 'wdio-mediawiki';
import WikibaseApi from 'wdio-wikibase/wikibase.api.js';
import { Options, Frameworks } from '@wdio/types';
import { defaultFunctions as defaultFunctionsInit } from './helpers/default-functions.js';
import JsonReporter from './helpers/json-reporter.js';

const resultsDir = process.env.RESULTS_DIR;
const screenshotPath = `${resultsDir}/screenshots`;
Expand Down Expand Up @@ -55,7 +55,7 @@ export const config: WebdriverIO.Config = {

// Level of verbosity: "trace", "debug", "info", "warn", "error", "silent"
logLevel:
( process.env.SELENIUM_LOG_LEVEL as Options.WebDriverLogTypes ) || 'error',
( process.env.SELENIUM_LOG_LEVEL as Options.WebDriverLogTypes ) || 'error',

// Default timeout for each waitFor* command.
waitforTimeout: 30 * 1000,
Expand Down Expand Up @@ -131,7 +131,7 @@ export const config: WebdriverIO.Config = {
const screenshotFilename = `${testFile}__${test.title}`;

try {
saveScreenshot( screenshotPath, screenshotFilename );
saveScreenshot( screenshotFilename, screenshotPath );
} catch ( error ) {
console.error( 'failed writing screenshot ...' );
console.error( error );
Expand Down
Loading