-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
T350879 extend special item test (#528)
- Loading branch information
Showing
1 changed file
with
30 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ); | ||
} ); | ||
} ); |