-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WEBUI-1399: Update ftest for features: Collections
- Loading branch information
1 parent
c2c1782
commit 20bbe52
Showing
8 changed files
with
257 additions
and
148 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
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
75 changes: 59 additions & 16 deletions
75
packages/nuxeo-web-ui-ftest/features/step_definitions/collections.js
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,26 +1,69 @@ | ||
import { Then } from '../../node_modules/@cucumber/cucumber'; | ||
|
||
Then('I can see the {string} collection', function(name) { | ||
this.ui.drawer.collections.waitForHasCollection(name).should.be.true; | ||
Then('I can see the {string} collection', async function(name) { | ||
const collection = await this.ui.drawer.collections.waitForHasCollection(name); | ||
if (!collection) { | ||
throw new Error(`Expected I can not click on the ${name} collection`); | ||
} | ||
}); | ||
Then('I can click on the {string} collection', function(name) { | ||
this.ui.drawer.collections.select(name).should.be.true; | ||
|
||
Then('I can click on the {string} collection', async function(name) { | ||
const myCollection = await this.ui.drawer; | ||
const collectionsEle = await myCollection.collections; | ||
const selectEle = await collectionsEle.select(name); | ||
if (!selectEle) { | ||
throw new Error(`Expected I can not click on the ${name} collection`); | ||
} | ||
}); | ||
Then('I can see that the document belongs to the collection', function() { | ||
this.ui.browser.waitForHasChild(this.doc).should.be.true; | ||
|
||
Then('I can see that the document belongs to the collection', async function() { | ||
const browser = await this.ui.browser; | ||
const hasChild = await browser.waitForHasChild(this.doc); | ||
if (!hasChild) { | ||
throw new Error('Expected the document belongs to the collection not be visible'); | ||
} | ||
}); | ||
Then('I can click the document in the collection', function() { | ||
this.ui.browser.clickChild(this.doc.title).should.be.true; | ||
|
||
Then('I can click the document in the collection', async function() { | ||
const browserEle = await this.ui.browser; | ||
const clickDocument = await browserEle.clickChild(this.doc.title); | ||
if (!clickDocument) { | ||
throw new Error('Expected I cannot click the document in the collection'); | ||
} | ||
}); | ||
Then('I can see the collection is in queue mode', function() { | ||
this.ui.drawer.collections.isQueueMode.should.be.true; | ||
|
||
Then('I can see the collection is in queue mode', async function() { | ||
const drawerEle = await this.ui.drawer; | ||
const collectionsEle = await drawerEle.collections; | ||
const isQueueModeEle = await collectionsEle.isQueueMode; | ||
if (!isQueueModeEle) { | ||
throw new Error('Expected the collection is in queue mode is not visible'); | ||
} | ||
}); | ||
Then('I can see the collection queue has the document', function() { | ||
this.ui.drawer.collections.waitForHasMember(this.doc).should.be.true; | ||
|
||
Then('I can see the collection queue has the document', async function() { | ||
const drawerEle = await this.ui.drawer; | ||
const collectionsEle = await drawerEle.collections; | ||
const hasMemberEle = await collectionsEle.waitForHasMember(this.doc); | ||
if (!hasMemberEle) { | ||
throw new Error('Expected the collection queue has the document is not visible'); | ||
} | ||
}); | ||
Then('I can remove the document from the collection queue', function() { | ||
this.ui.drawer.collections.removeMember(this.doc).should.be.true; | ||
|
||
Then('I can remove the document from the collection queue', async function() { | ||
const draweerEle = await this.ui.drawer; | ||
const collectionsEle = await draweerEle.collections; | ||
const removeMemberEle = await collectionsEle.removeMember(this.doc); | ||
if (!removeMemberEle) { | ||
throw new Error('Expected I can not remove the document from the collection queue'); | ||
} | ||
}); | ||
Then('I can see the collection queue does not have the document', function() { | ||
this.ui.drawer.collections.waitForHasMember(this.doc, true).should.be.true; | ||
|
||
Then('I can see the collection queue does not have the document', async function() { | ||
const drawerEle = await this.ui.drawer; | ||
const collectionsEle = await drawerEle.collections; | ||
const hasMemberEle = await collectionsEle.waitForHasMember(this.doc, true); | ||
if (!hasMemberEle) { | ||
throw new Error('Expected the collection queue does not have the document is not visible'); | ||
} | ||
}); |
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
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
13 changes: 7 additions & 6 deletions
13
packages/nuxeo-web-ui-ftest/pages/ui/browser/add_to_collection_dialog.js
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
Oops, something went wrong.