Skip to content

Commit

Permalink
T350879 extend special item test (#528)
Browse files Browse the repository at this point in the history
  • Loading branch information
adeeri authored Nov 21, 2023
1 parent b81b617 commit 2ebcf2d
Showing 1 changed file with 30 additions and 3 deletions.
33 changes: 30 additions & 3 deletions test/specs/repo/special-item.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,42 @@
import ItemPage from 'wdio-wikibase/pageobjects/item.page.js';
import SpecialNewItem from '../../helpers/pages/special/new-item.page.js';
import assert from 'assert';

describe( 'Special:NewItem', function () {
it( 'Should be able to create a new item', async () => {

const label = 'Cool label';
const description = 'Cool description';
const firstAlias = 'Great job';
const secondAlias = 'Bra Jobbat';

await SpecialNewItem.open();

await SpecialNewItem.labelInput.setValue( 'Cool label' );
await SpecialNewItem.descriptionInput.setValue( 'Cool description' );
await SpecialNewItem.aliasesInput.setValue( 'Great job!|Bra Jobbat' );
await SpecialNewItem.labelInput.setValue( label );
await SpecialNewItem.descriptionInput.setValue( description );
await SpecialNewItem.aliasesInput.setValue( firstAlias + '|' + secondAlias );
await SpecialNewItem.submit();

await ItemPage.addStatementLink;

const labelText = await $(
'.wikibase-entitytermsforlanguageview-label'
).getText();
assert.strictEqual( labelText, label );

const descriptionText = await $(
'.wikibase-entitytermsforlanguageview-description'
).getText();
assert.strictEqual( descriptionText, description );

const firstAliasText = await $(
'.wikibase-entitytermsforlanguageview-aliases li:nth-child(1)'
).getText();
assert.strictEqual( firstAliasText, firstAlias );

const secondAliasText = await $(
'.wikibase-entitytermsforlanguageview-aliases li:nth-child(2)'
).getText();
assert.strictEqual( secondAliasText, secondAlias );
} );
} );

0 comments on commit 2ebcf2d

Please sign in to comment.