Skip to content

Commit

Permalink
All
Browse files Browse the repository at this point in the history
  • Loading branch information
RickiJay-WMDE committed Apr 15, 2024
1 parent f0bf3b3 commit 19cfb57
Show file tree
Hide file tree
Showing 28 changed files with 103 additions and 103 deletions.
2 changes: 1 addition & 1 deletion test/specs/confirm_edit/confirm-edit.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import assert from 'assert';

describe( 'ConfirmEdit', function () {
it( 'Should allow to edit with captcha', async () => {
it( 'Should allow to edit with captcha', async function () {
const executionResult = await browser.editPage(
testEnv.vars.WIKIBASE_URL,
'ConfirmEditTest',
Expand Down
6 changes: 3 additions & 3 deletions test/specs/elasticsearch/elasticsearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const itemLabel: string = getTestString( 'testItem' );
describe( 'ElasticSearch', function () {
let itemId: string;

it( 'Should create an item', async () => {
it( 'Should create an item', async function () {
itemId = await WikibaseApi.createItem( itemLabel );

await ItemPage.open( itemId );
Expand All @@ -18,7 +18,7 @@ describe( 'ElasticSearch', function () {
);
} );

it( 'Should be able to set alias', async () => {
it( 'Should be able to set alias', async function () {
await browser.url( `${testEnv.vars.WIKIBASE_URL}/wiki/Special:SetAliases/` );

// input id
Expand All @@ -33,7 +33,7 @@ describe( 'ElasticSearch', function () {
await expect( $( '.wikibase-aliasesview-list-item' ) ).toHaveText( itemAlias );
} );

it( 'should be able to search case-insensitive', async () => {
it( 'should be able to search case-insensitive', async function () {
let searchResult: SearchResult[];

const testLabel = 'Testitem';
Expand Down
14 changes: 7 additions & 7 deletions test/specs/fedprops/item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe( 'Fed props Item', function () {
const itemId = 'Q1';
const itemLabel = 'T267743-';

it( 'Should search wikidata.org through wbsearchentities with no local properties', async () => {
it( 'Should search wikidata.org through wbsearchentities with no local properties', async function () {
const result = await browser.makeRequest(
`${testEnv.vars.WIKIBASE_URL}/w/api.php?action=wbsearchentities&search=ISNI&format=json&language=en&type=property`
);
Expand All @@ -24,7 +24,7 @@ describe( 'Fed props Item', function () {
assert( searchResults.length > 0 );
} );

it( 'can add a federated property and it shows up in the ui', async () => {
it( 'can add a federated property and it shows up in the ui', async function () {
const data = {
claims: [
{
Expand All @@ -50,7 +50,7 @@ describe( 'Fed props Item', function () {
await SpecialEntityPage.addStatementLink;
} );

it( 'should NOT show up in Special:EntityData with ttl', async () => {
it( 'should NOT show up in Special:EntityData with ttl', async function () {
try {
await SpecialEntityDataPage.getData( 'Q1', 'ttl' );
} catch ( error ) {
Expand All @@ -59,15 +59,15 @@ describe( 'Fed props Item', function () {
}
} );

it( 'should show up in Special:EntityData with json', async () => {
it( 'should show up in Special:EntityData with json', async function () {
const data = await SpecialEntityDataPage.getData( 'Q1' );
assert.notEqual(
data.entities.Q1.claims[ 'http://www.wikidata.org/entity/P213' ],
null
);
} );

it( 'should NOT show up in Special:EntityData with rdf', async () => {
it( 'should NOT show up in Special:EntityData with rdf', async function () {
try {
await SpecialEntityDataPage.getData( 'Q1', 'rdf' );
} catch ( error ) {
Expand All @@ -76,7 +76,7 @@ describe( 'Fed props Item', function () {
}
} );

it( 'should NOT show property in queryservice ui after creation using prefixes', async () => {
it( 'should NOT show property in queryservice ui after creation using prefixes', async function () {
const prefixes = [ 'prefix fpwdt: <http://www.wikidata.org/prop/direct/>' ];
const query = `SELECT * WHERE{ ?s fpwdt:${propertyId} ?o }`;

Expand All @@ -98,7 +98,7 @@ describe( 'Fed props Item', function () {
);
} );

it( 'should NOT show up in queryservice ui after creation', async () => {
it( 'should NOT show up in queryservice ui after creation', async function () {
// query the item using wd: prefix
await QueryServiceUIPage.open( `SELECT * WHERE{ wd:${itemId} ?p ?o }` );

Expand Down
8 changes: 4 additions & 4 deletions test/specs/fedprops/prefetching.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe( 'Property Prefetching', function () {
const itemLabel = 'T267743-';
const NUM_PROPERTIES = 25;

it( 'can add many federated properties and it shows up in the ui', async () => {
it( 'can add many federated properties and it shows up in the ui', async function () {
await browser.url(
'https://www.wikidata.org/wiki/Special:ListProperties?datatype=string'
);
Expand Down Expand Up @@ -45,7 +45,7 @@ describe( 'Property Prefetching', function () {
);
} );

it( 'should delete all statements and generate individual changes', async () => {
it( 'should delete all statements and generate individual changes', async function () {
const statements = await $$( '.wikibase-statementview' );
const propertyGuids = await Promise.all(
statements.map( async ( statement ) => statement.getAttribute( 'id' ) )
Expand All @@ -63,7 +63,7 @@ describe( 'Property Prefetching', function () {
await browser.pause( 2000 );
} );

it( 'Should render history page list within threshold', async () => {
it( 'Should render history page list within threshold', async function () {
await ItemPage.open( itemId, { action: 'history' } );
await $( '#pagehistory' );

Expand All @@ -74,7 +74,7 @@ describe( 'Property Prefetching', function () {
);
} );

it( 'Should render recent changes list within threshold', async () => {
it( 'Should render recent changes list within threshold', async function () {
await browser.url(
`${testEnv.vars.WIKIBASE_URL}/wiki/Special:RecentChanges?limit=50&days=7&urlversion=2&enhanced=0`
);
Expand Down
2 changes: 1 addition & 1 deletion test/specs/pingback/pingback.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import assert from 'assert';

describe( 'Pingback', function () {
it( 'Should ping on first page request', async () => {
it( 'Should ping on first page request', async function () {
await browser.url( testEnv.vars.WIKIBASE_URL + '/wiki/Main_Page' );

// eslint-disable-next-line wdio/no-pause
Expand Down
42 changes: 21 additions & 21 deletions test/specs/quickstatements/quickstatements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ describe( 'QuickStatements Service', function () {
let propertyIdItem = null;
let propertyURL = null;

it( 'Should be able to load the start page', async () => {
it( 'Should be able to load the start page', async function () {
await browser.url( testEnv.vars.QUICKSTATEMENTS_URL );
await $( 'body' ).$( 'p*=QuickStatements is a tool' );
} );

it( 'Should be able to log in', async () => {
it( 'Should be able to log in', async function () {
await browser.url(
`${testEnv.vars.QUICKSTATEMENTS_URL}/api.php?action=oauth_redirect`
);
Expand Down Expand Up @@ -92,14 +92,14 @@ describe( 'QuickStatements Service', function () {
await expect( $( 'nav.navbar' ) ).toHaveTextContaining( 'QuickStatements' );
} );

it( 'Should be able to click batch button and be taken to the next page', async () => {
it( 'Should be able to click batch button and be taken to the next page', async function () {
await browser.url( `${testEnv.vars.QUICKSTATEMENTS_URL}/#` );
await $( 'a[tt="new_batch"]=New batch' ).click();

await expect( $( 'span=Create new command batch for' ) ).toExist();
} );

it( 'Should be able to create two items', async () => {
it( 'Should be able to create two items', async function () {
await browser.url( `${testEnv.vars.QUICKSTATEMENTS_URL}/#/batch` );

await browser.executeQuickStatement( 'CREATE\nCREATE' );
Expand All @@ -111,7 +111,7 @@ describe( 'QuickStatements Service', function () {
assert.strictEqual( responseQ2Data.entities.Q2.id, 'Q2' );
} );

it( 'Should be able to create item with label', async () => {
it( 'Should be able to create item with label', async function () {
await browser.url( `${testEnv.vars.QUICKSTATEMENTS_URL}/#/batch` );

await browser.executeQuickStatement( 'CREATE\nLAST|Len|"Best label"' );
Expand All @@ -124,7 +124,7 @@ describe( 'QuickStatements Service', function () {
);
} );

it( 'Should be able to create an item with statement', async () => {
it( 'Should be able to create an item with statement', async function () {
await browser.url( `${testEnv.vars.QUICKSTATEMENTS_URL}/#/batch` );

const stringPropertyId = await WikibaseApi.createProperty( 'string' );
Expand All @@ -140,7 +140,7 @@ describe( 'QuickStatements Service', function () {
).toBe( 'slippery fish' );
} );

it( 'Should be able to add an alias to an item', async () => {
it( 'Should be able to add an alias to an item', async function () {
await browser.executeQuickStatement( 'Q1|ASv|"Kommer det funka?"' );

// go look at wikibase
Expand All @@ -149,7 +149,7 @@ describe( 'QuickStatements Service', function () {
assert( lodash.isEmpty( responseQ1Data.entities.Q1.aliases ) !== true );
} );

it( 'Should be able to add a label to an item', async () => {
it( 'Should be able to add a label to an item', async function () {
await browser.executeQuickStatement( 'Q1|LSv|"Some label"' );

// go look at wikibase
Expand All @@ -158,7 +158,7 @@ describe( 'QuickStatements Service', function () {
assert( lodash.isEmpty( responseQ1Data.entities.Q1.labels ) !== true );
} );

it( 'Should be able to add a description to an item', async () => {
it( 'Should be able to add a description to an item', async function () {
await browser.executeQuickStatement( 'Q1|DSv|"Kommer det funka?"' );

// go look at wikibase
Expand All @@ -167,7 +167,7 @@ describe( 'QuickStatements Service', function () {
assert( lodash.isEmpty( responseQ1Data.entities.Q1.descriptions ) !== true );
} );

it.skip( 'Should be able to add a sitelink to an item', async () => {
it.skip( 'Should be able to add a sitelink to an item', async function () {
await browser.executeQuickStatement( 'Q1|Sclient_wiki|"Main_Page"' );

// go look at wikibase
Expand All @@ -176,7 +176,7 @@ describe( 'QuickStatements Service', function () {
assert( lodash.isEmpty( responseQ1Data.entities.Q1.sitelinks ) !== true );
} );

it( 'Should be able to add a statement to an item', async () => {
it( 'Should be able to add a statement to an item', async function () {
propertyId = await WikibaseApi.getProperty( 'string' );

await browser.executeQuickStatement( `Q1|${propertyId}|"Will it blend?"` );
Expand All @@ -192,12 +192,12 @@ describe( 'QuickStatements Service', function () {
);
} );

describe( 'Should be able to add qualifiers to statements with a range of datatypes', () => {
describe( 'Should be able to add qualifiers to statements with a range of datatypes', function () {
// should be disabled for dynamic tests
// eslint-disable-next-line mocha/no-setup-in-describe
mainSnakDataTypes.forEach( ( mainSnakDataType ) => {
qualifierSnakDataTypes.forEach( ( qualifierSnakDataType ) => {
it( `Should be able to add a ${mainSnakDataType} statement with a ${qualifierSnakDataType} qualifier.`, async () => {
it( `Should be able to add a ${mainSnakDataType} statement with a ${qualifierSnakDataType} qualifier.`, async function () {
const itemId = await WikibaseApi.createItem( 'qualifier-item', {} );

const mainPropertyId =
Expand All @@ -221,7 +221,7 @@ describe( 'QuickStatements Service', function () {
} );
} );

it( 'Should be able to add statement with qualifiers', async () => {
it( 'Should be able to add statement with qualifiers', async function () {
propertyIdItem = await WikibaseApi.getProperty( 'wikibase-item' );

await browser.executeQuickStatement(
Expand All @@ -235,7 +235,7 @@ describe( 'QuickStatements Service', function () {
);
} );

it( 'Should be able to add a property with "wikibase-item" reference', async () => {
it( 'Should be able to add a property with "wikibase-item" reference', async function () {
const itemId = await WikibaseApi.createItem( 'reference-item', {} );

propertyIdItem = await WikibaseApi.getProperty( 'wikibase-item' );
Expand All @@ -257,7 +257,7 @@ describe( 'QuickStatements Service', function () {
assert.strictEqual( refValue.id, 'Q2' );
} );

it( 'Should be able to add a property with "url" reference', async () => {
it( 'Should be able to add a property with "url" reference', async function () {
const itemId = await WikibaseApi.createItem( 'reference-url', {} );
propertyURL = await WikibaseApi.getProperty( 'url' );
const url = '"https://www.wikidata.org"';
Expand All @@ -275,7 +275,7 @@ describe( 'QuickStatements Service', function () {
assert.strictEqual( refValue, 'https://www.wikidata.org' );
} );

it( 'Should be able to add a property with "string" reference', async () => {
it( 'Should be able to add a property with "string" reference', async function () {
const itemId = await WikibaseApi.createItem( 'reference-string', {} );
const stringValue = '"some string"';
const propertyNumber = propertyId.replace( 'P', '' );
Expand All @@ -291,7 +291,7 @@ describe( 'QuickStatements Service', function () {
assert.strictEqual( refValue, 'some string' );
} );

it( 'Should be able to add and remove a property on an item', async () => {
it( 'Should be able to add and remove a property on an item', async function () {
const itemId = await WikibaseApi.createItem( 'add-remove', {} );

await browser.executeQuickStatement( `${itemId}|${propertyIdItem}|Q1` );
Expand All @@ -311,7 +311,7 @@ describe( 'QuickStatements Service', function () {
);
} );

it( 'Should be able to change label', async () => {
it( 'Should be able to change label', async function () {
await browser.executeQuickStatement( 'Q1|LSv|"Some other label"' );

const responseQ1Data = await SpecialEntityDataPage.getData( 'Q1' );
Expand All @@ -321,7 +321,7 @@ describe( 'QuickStatements Service', function () {
);
} );

it( 'Should be able to merge two items', async () => {
it( 'Should be able to merge two items', async function () {
await browser.url( `${testEnv.vars.QUICKSTATEMENTS_URL}/#/batch` );

await browser.executeQuickStatement( 'MERGE|Q1|Q2' );
Expand All @@ -330,7 +330,7 @@ describe( 'QuickStatements Service', function () {
assert.strictEqual( responseQ2Data.entities.Q1.id, 'Q1' );
} );

it( 'Should have a Last Batches button', async () => {
it( 'Should have a Last Batches button', async function () {
await browser.url( `${testEnv.vars.QUICKSTATEMENTS_URL}/#/batch` );

await $( 'a[tt="show_your_last_batches"]=Your last batches' ).click();
Expand Down
2 changes: 1 addition & 1 deletion test/specs/repo/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const dataTypes = [ wikibasePropertyString ];
describe( 'Wikibase API', function () {
// eslint-disable-next-line mocha/no-setup-in-describe
dataTypes.forEach( ( dataType: WikibasePropertyType ) => {
it( `Should be able to create many properties and items of type ${dataType.name}`, async () => {
it( `Should be able to create many properties and items of type ${dataType.name}`, async function () {
Array( 100 ).forEach( async () => {
const itemLabel = 'T267743-';
const propertyValue = `PropertyExample${dataType.name}Value`;
Expand Down
2 changes: 1 addition & 1 deletion test/specs/repo/extensions/babel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe( 'Babel', function () {
await browser.skipIfExtensionNotPresent( this, 'Babel' );
} );

it( 'Should be able to update the user page with language skills', async () => {
it( 'Should be able to update the user page with language skills', async function () {
await LoginPage.login( testEnv.vars.MW_ADMIN_NAME, testEnv.vars.MW_ADMIN_PASS );

const executionContent = await browser.editPage(
Expand Down
2 changes: 1 addition & 1 deletion test/specs/repo/extensions/entityschema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe( 'EntitySchema', function () {
await browser.skipIfExtensionNotPresent( this, 'EntitySchema' );
} );

it( 'Should be able to create an EntitySchema', async () => {
it( 'Should be able to create an EntitySchema', async function () {
await browser.url( testEnv.vars.WIKIBASE_URL + '/wiki/EntitySchema:test' );

// gives the link to Special:NewEntitySchema
Expand Down
4 changes: 2 additions & 2 deletions test/specs/repo/extensions/scribunto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe( 'Scribunto', function () {
await browser.skipIfExtensionNotPresent( this, 'Scribunto' );
} );

it( 'Should be able to execute lua module', async () => {
it( 'Should be able to execute lua module', async function () {
// eslint-disable-next-line security/detect-non-literal-fs-filename
const fileContents = await readFile( new URL( 'bananas.lua', import.meta.url ), utf8 );
await browser.editPage(
Expand All @@ -26,7 +26,7 @@ describe( 'Scribunto', function () {
assert( executionContent.includes( 'Hello, world!' ) );
} );

it( 'Should be able to execute lua module within 0.05 seconds', async () => {
it( 'Should be able to execute lua module within 0.05 seconds', async function () {
const cpuTime = await browser.getLuaCpuTime(
testEnv.vars.WIKIBASE_URL,
'LuaTest'
Expand Down
2 changes: 1 addition & 1 deletion test/specs/repo/extensions/syntax-highlight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe( 'SyntaxHighlight', function () {
await browser.skipIfExtensionNotPresent( this, 'SyntaxHighlight' );
} );

it( 'Should highlight lua script', async () => {
it( 'Should highlight lua script', async function () {
// eslint-disable-next-line security/detect-non-literal-fs-filename
const fileContents = await readFile( new URL( 'bananas.lua', import.meta.url ), utf8 );

Expand Down
2 changes: 1 addition & 1 deletion test/specs/repo/extensions/universal-language-selector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ describe( 'UniversalLanguageSelector', function () {
await browser.skipIfExtensionNotPresent( this, 'UniversalLanguageSelector' );
} );

it( 'Should be able to see the language selector menu', async () => {
it( 'Should be able to see the language selector menu', async function () {
await browser.url( testEnv.vars.WIKIBASE_URL );
await $( '#searchInput' ).click();
await $( '.imeselector' ).click();
Expand Down
2 changes: 1 addition & 1 deletion test/specs/repo/extensions/visual-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ describe( 'VisualEditor', function () {
await browser.skipIfExtensionNotPresent( this, 'VisualEditor' );
} );

it( 'Should be able to edit a page using the editor', async () => {
it( 'Should be able to edit a page using the editor', async function () {
await browser.url(
testEnv.vars.WIKIBASE_URL + '/wiki/TestVisualEditor?veaction=edit'
);
Expand Down
Loading

0 comments on commit 19cfb57

Please sign in to comment.