-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathWorkSpaceTests.ts
83 lines (72 loc) · 2.93 KB
/
WorkSpaceTests.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
import MenuFragment from "../../pages/MenuFragment";
import WorkSpacePage from "../../pages/WorkSpacePage";
import * as assert from "assert";
import WelcomePage from "../../pages/WelcomePage";
import SignInPage from "../../pages/SignInPage";
import {userFixture} from "../../fixture/User";
describe("WorkSpace Suite", () => {
it('Check workspace', async () => {
await MenuFragment.menuButtonClick()
await MenuFragment.workSpaceButtonClick()
await MenuFragment.backMenuButtonClick()
await WorkSpacePage.availableTabClick()
await WorkSpacePage.activedTabClick()
assert.ok(await WorkSpacePage.availableTabIsDisplayed(), 'Workspaces tab not presented')
})
it('Sync On Campus', async () => {
await MenuFragment.menuButtonClick()
await MenuFragment.workSpaceButtonClick()
await MenuFragment.backMenuButtonClick()
await WorkSpacePage.availableTabClick()
await WorkSpacePage.activeFirstElementClick()
await WorkSpacePage.dialogActiveClick()
assert.ok(await WorkSpacePage.checkBoxOnIsDisplayed(),'Sync not ON')
})
it('Sync Off Campus', async () => {
await MenuFragment.menuButtonClick()
await MenuFragment.workSpaceButtonClick()
await MenuFragment.backMenuButtonClick()
await WorkSpacePage.syncCheckBoxClick()
await WorkSpacePage.dialogActiveClick()
assert.ok(await WorkSpacePage.checkBoxOffIsDisplayed(),'Sync not OFF')
})
before(async function() {
await SignInPage.pushFileToDevice()
if (!userFixture.isLocal){
let name = this.test.parent.title
const executorConfigName = {
"action": "setSessionName",
"arguments": {
"name": name
}
};
await driver.execute('browserstack_executor: ' + JSON.stringify(executorConfigName));}
const contexts = await driver.getContexts(); // get list of context
await driver.switchContext(contexts[0].toString()); // set context to APP_NATIVE
await WelcomePage.signInHomeButtonClick()
await WelcomePage.signInButtonClick()
if (!userFixture.isLocal){
if (await WelcomePage.webViewButtonIsDisplayed(3000)){
await WelcomePage.chromeChoseClick()
await WelcomePage.alwaysClick()
}
}
if (await WelcomePage.logOutButtonIsDisplayed(10000)){
await WelcomePage.logOutButtonClick()
await SignInPage.signInLocal()
}else {
await SignInPage.signInLocal()
}
});
after(async function () {
if (!userFixture.isLocal){
let state = this.currentTest.state
const executorConfig = {
"action": "setSessionStatus",
"arguments": {
"status": state
},
};
await driver.execute('browserstack_executor: ' + JSON.stringify(executorConfig));}
});
})