|
|
|
@ -3,12 +3,13 @@ import EventEmitter from 'events' |
|
|
|
|
|
|
|
|
|
class switchWorkspace extends EventEmitter { |
|
|
|
|
command (this: NightwatchBrowser, workspaceName: string): NightwatchBrowser { |
|
|
|
|
this.api.waitForElementVisible('[data-id="workspacesSelect"]') |
|
|
|
|
this.api |
|
|
|
|
.waitForElementVisible('[data-id="workspacesSelect"]') |
|
|
|
|
.waitForElementPresent(`[data-id="dropdown-item-${workspaceName}"]`) |
|
|
|
|
.click('[data-id="workspacesSelect"]') |
|
|
|
|
.waitForElementVisible(`[data-id="dropdown-item-${workspaceName}"]`) |
|
|
|
|
.pause(2000) |
|
|
|
|
.click(`[data-id="dropdown-item-${workspaceName}"]`) |
|
|
|
|
.pause(3000) |
|
|
|
|
.pause(4000) |
|
|
|
|
.perform((done) => { |
|
|
|
|
done() |
|
|
|
|
this.emit('complete') |
|
|
|
|