@open-xchange/appsuite-codeceptjs 0.6.11 → 0.6.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +2 -19
- package/package.json +5 -5
- package/src/contexts/contexts.js +6 -1
- package/spec/pageobjects/calendar.test.js +0 -123
- package/src/pageobjects/calendar.js +0 -229
- package/src/pageobjects/contacts.js +0 -149
- package/src/pageobjects/drive.js +0 -96
- package/src/pageobjects/fragments/contact-autocomplete.js +0 -45
- package/src/pageobjects/fragments/contact-picker.js +0 -50
- package/src/pageobjects/fragments/dialogs.js +0 -41
- package/src/pageobjects/fragments/search.js +0 -54
- package/src/pageobjects/fragments/settings-mailfilter.js +0 -90
- package/src/pageobjects/fragments/settings.js +0 -71
- package/src/pageobjects/fragments/tinymce.js +0 -41
- package/src/pageobjects/fragments/topbar.js +0 -43
- package/src/pageobjects/fragments/viewer.js +0 -67
- package/src/pageobjects/mail.js +0 -66
- package/src/pageobjects/mobile/mobileCalendar.js +0 -41
- package/src/pageobjects/mobile/mobileContacts.js +0 -39
- package/src/pageobjects/mobile/mobileMail.js +0 -51
- package/src/pageobjects/tasks.js +0 -58
- package/src/pageobjects/util.js +0 -34
package/src/pageobjects/drive.js
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright Copyright (c) Open-Xchange GmbH, Germany <info@open-xchange.com>
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
*
|
|
5
|
-
* This code is free software: you can redistribute it and/or modify
|
|
6
|
-
* it under the terms of the GNU Affero General Public License as published by
|
|
7
|
-
* the Free Software Foundation, either version 3 of the License, or
|
|
8
|
-
* (at your option) any later version.
|
|
9
|
-
*
|
|
10
|
-
* This program is distributed in the hope that it will be useful,
|
|
11
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
-
* GNU Affero General Public License for more details.
|
|
14
|
-
*
|
|
15
|
-
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
-
* along with OX App Suite. If not, see <https://www.gnu.org/licenses/agpl-3.0.txt>.
|
|
17
|
-
*
|
|
18
|
-
* Any use of the work other than as authorized under this license or copyright law is prohibited.
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
const { I, dialogs } = inject()
|
|
22
|
-
|
|
23
|
-
module.exports = {
|
|
24
|
-
|
|
25
|
-
openSecondary () {
|
|
26
|
-
I.waitForElement('~New')
|
|
27
|
-
I.click('.primary-action > .dropdown > button')
|
|
28
|
-
I.waitForElement('.dropdown.open .dropdown-menu')
|
|
29
|
-
},
|
|
30
|
-
clickSecondary (name) {
|
|
31
|
-
this.openSecondary()
|
|
32
|
-
I.click(name, '.dropdown.open .dropdown-menu')
|
|
33
|
-
},
|
|
34
|
-
selectFile (title, { timeout = undefined } = {}) {
|
|
35
|
-
I.waitForElement(`.filename[title="${title}"]`, timeout)
|
|
36
|
-
I.click(`.filename[title="${title}"]`)
|
|
37
|
-
I.wait(0.5) // wait for toolbar rendering
|
|
38
|
-
},
|
|
39
|
-
shareFolder (name, role) {
|
|
40
|
-
I.clickToolbar('Share')
|
|
41
|
-
dialogs.waitForVisible()
|
|
42
|
-
I.waitForText('Share folder')
|
|
43
|
-
|
|
44
|
-
if (role !== 'Viewer') {
|
|
45
|
-
I.waitForVisible('.permission-pre-selection .btn')
|
|
46
|
-
I.click('.permission-pre-selection .btn')
|
|
47
|
-
I.clickDropdown(role)
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
I.waitForText(role, undefined, '.permission-pre-selection')
|
|
51
|
-
I.click('~Select contacts')
|
|
52
|
-
|
|
53
|
-
// dialog is open
|
|
54
|
-
dialogs.waitForVisible()
|
|
55
|
-
I.waitForElement('.modal-body .list-view.address-picker li.list-item') // check if list items are loaded
|
|
56
|
-
I.fillField('Search', name)
|
|
57
|
-
I.waitForText(name, undefined, '.modal-dialog .address-picker')
|
|
58
|
-
I.waitForElement('.address-picker .list-item')
|
|
59
|
-
I.click('.address-picker .list-item')
|
|
60
|
-
dialogs.clickButton('Select')
|
|
61
|
-
|
|
62
|
-
I.waitForText('Share folder', undefined, dialogs.header)
|
|
63
|
-
I.waitForText('ADDED', undefined, '.permissions-view .permission.row:first-child .added')
|
|
64
|
-
I.see('Owner', '.permissions-view .permission.row:last-child')
|
|
65
|
-
I.see(role, '.permissions-view .permission.row:first-child')
|
|
66
|
-
I.see('Internal user (' + name + ')', '.permissions-view .permission.row:first-child .description')
|
|
67
|
-
dialogs.clickButton('Share')
|
|
68
|
-
I.waitForDetached('.modal-dialog')
|
|
69
|
-
},
|
|
70
|
-
moveManuallyTo (destination) {
|
|
71
|
-
I.clickToolbar('More actions')
|
|
72
|
-
I.clickDropdown('Move')
|
|
73
|
-
|
|
74
|
-
I.waitForElement('.folder-picker-dialog')
|
|
75
|
-
I.waitForElement(`.folder-picker-dialog [data-id="${destination}"]`)
|
|
76
|
-
I.click(`.folder-picker-dialog [data-id="${destination}"]`)
|
|
77
|
-
I.waitForElement(`.folder-picker-dialog [data-id="${destination}"].selected`)
|
|
78
|
-
I.click('Move', '.folder-picker-dialog')
|
|
79
|
-
I.waitForDetached('.folder-picker-dialog')
|
|
80
|
-
},
|
|
81
|
-
seeListViewIcon (itemName, icon, title) {
|
|
82
|
-
I.seeElement(`.list-item .filename[title="${itemName}"] ~ .icons span[title="${title}"] .${icon}`)
|
|
83
|
-
},
|
|
84
|
-
seeNumberOfListViewIcons (itemName, count) {
|
|
85
|
-
I.seeNumberOfElements(`.list-item .filename[title="${itemName}"] ~ .icons span`, count)
|
|
86
|
-
},
|
|
87
|
-
seeInternalUserInShareSection (userName, email) {
|
|
88
|
-
I.waitForText(`${userName}${email}`, undefined, '.viewer-shares-info')
|
|
89
|
-
},
|
|
90
|
-
seeGuestInShareSection (email) {
|
|
91
|
-
I.waitForText(`${email}Guest`, undefined, '.viewer-shares-info')
|
|
92
|
-
},
|
|
93
|
-
seePublicLinkInShareSection () {
|
|
94
|
-
I.waitForText('Public link', undefined, '.viewer-shares-info')
|
|
95
|
-
}
|
|
96
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright Copyright (c) Open-Xchange GmbH, Germany <info@open-xchange.com>
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
*
|
|
5
|
-
* This code is free software: you can redistribute it and/or modify
|
|
6
|
-
* it under the terms of the GNU Affero General Public License as published by
|
|
7
|
-
* the Free Software Foundation, either version 3 of the License, or
|
|
8
|
-
* (at your option) any later version.
|
|
9
|
-
*
|
|
10
|
-
* This program is distributed in the hope that it will be useful,
|
|
11
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
-
* GNU Affero General Public License for more details.
|
|
14
|
-
*
|
|
15
|
-
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
-
* along with OX App Suite. If not, see <https://www.gnu.org/licenses/agpl-3.0.txt>.
|
|
17
|
-
*
|
|
18
|
-
* Any use of the work other than as authorized under this license or copyright law is prohibited.
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
const { I } = inject()
|
|
22
|
-
|
|
23
|
-
module.exports = {
|
|
24
|
-
|
|
25
|
-
suggestion: locate('.tt-dropdown-menu .tt-suggestion:nth-of-type(1)').as('First suggestion'),
|
|
26
|
-
suggestions: locate('.tt-dropdown-menu').as('Suggestion dropdown'),
|
|
27
|
-
|
|
28
|
-
select (elementName, within) {
|
|
29
|
-
const context = within === '*' ? '//span[@class="tt-dropdown-menu"]' : `//div[contains(@class, "${within}")]//span[@class="tt-dropdown-menu"]`
|
|
30
|
-
|
|
31
|
-
I.waitForText(elementName, 10, context)
|
|
32
|
-
|
|
33
|
-
// searched entry could be a resource or user where the DOM structure differs
|
|
34
|
-
const searchEntry = locate(`${context}//div[@class="participant-name"]/strong[text()="${elementName}"]|//div[@class="participant-email"]/span/strong[text()="${elementName}"]`).as(elementName)
|
|
35
|
-
I.waitForElement(searchEntry, 10)
|
|
36
|
-
I.click(searchEntry)
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
selectFirst () {
|
|
40
|
-
I.waitForVisible(this.suggestion)
|
|
41
|
-
I.waitForEnabled(this.suggestion)
|
|
42
|
-
I.click(this.suggestion)
|
|
43
|
-
I.waitForInvisible(this.suggestions)
|
|
44
|
-
}
|
|
45
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright Copyright (c) Open-Xchange GmbH, Germany <info@open-xchange.com>
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
*
|
|
5
|
-
* This code is free software: you can redistribute it and/or modify
|
|
6
|
-
* it under the terms of the GNU Affero General Public License as published by
|
|
7
|
-
* the Free Software Foundation, either version 3 of the License, or
|
|
8
|
-
* (at your option) any later version.
|
|
9
|
-
*
|
|
10
|
-
* This program is distributed in the hope that it will be useful,
|
|
11
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
-
* GNU Affero General Public License for more details.
|
|
14
|
-
*
|
|
15
|
-
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
-
* along with OX App Suite. If not, see <https://www.gnu.org/licenses/agpl-3.0.txt>.
|
|
17
|
-
*
|
|
18
|
-
* Any use of the work other than as authorized under this license or copyright law is prohibited.
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
const { I } = inject()
|
|
22
|
-
|
|
23
|
-
module.exports = {
|
|
24
|
-
|
|
25
|
-
results: locate('.addressbook-popup').find('.list-item').as('Results'),
|
|
26
|
-
|
|
27
|
-
ready () {
|
|
28
|
-
I.waitForVisible('.addressbook-popup')
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
async add (query) {
|
|
32
|
-
this.ready()
|
|
33
|
-
await I.waitForFocus('.addressbook-popup .search-field')
|
|
34
|
-
I.fillField('.addressbook-popup .search-field', query)
|
|
35
|
-
I.waitForVisible(this.results)
|
|
36
|
-
this.selectFirst()
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
selectFirst () {
|
|
40
|
-
I.waitForEnabled(this.results)
|
|
41
|
-
I.waitForEnabled(this.results.first().as('First list item'))
|
|
42
|
-
I.click(this.results.first().as('First list item'))
|
|
43
|
-
I.waitForVisible(locate('.list-item.selected').as('Selected list item'))
|
|
44
|
-
},
|
|
45
|
-
|
|
46
|
-
close () {
|
|
47
|
-
I.click('Select')
|
|
48
|
-
I.waitToHide('.addressbook-popup')
|
|
49
|
-
}
|
|
50
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright Copyright (c) Open-Xchange GmbH, Germany <info@open-xchange.com>
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
*
|
|
5
|
-
* This code is free software: you can redistribute it and/or modify
|
|
6
|
-
* it under the terms of the GNU Affero General Public License as published by
|
|
7
|
-
* the Free Software Foundation, either version 3 of the License, or
|
|
8
|
-
* (at your option) any later version.
|
|
9
|
-
*
|
|
10
|
-
* This program is distributed in the hope that it will be useful,
|
|
11
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
-
* GNU Affero General Public License for more details.
|
|
14
|
-
*
|
|
15
|
-
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
-
* along with OX App Suite. If not, see <https://www.gnu.org/licenses/agpl-3.0.txt>.
|
|
17
|
-
*
|
|
18
|
-
* Any use of the work other than as authorized under this license or copyright law is prohibited.
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
const { I } = inject()
|
|
22
|
-
|
|
23
|
-
module.exports = {
|
|
24
|
-
|
|
25
|
-
main: locate('.modal:not(.hidden):not(.modal-paused) .modal-dialog').as('Modal Main'),
|
|
26
|
-
header: locate('.modal:not(.hidden):not(.modal-paused) .modal-header').as('Modal Header'),
|
|
27
|
-
body: locate('.modal:not(.hidden):not(.modal-paused) .modal-body').as('Modal Body'),
|
|
28
|
-
footer: locate('.modal:not(.hidden):not(.modal-paused) .modal-footer').as('Modal Footer'),
|
|
29
|
-
|
|
30
|
-
clickButton (label) {
|
|
31
|
-
const buttonLocator = locate('.modal:not(.hidden):not(.modal-paused) .modal-footer button').withText(label).as(label)
|
|
32
|
-
I.waitForVisible(buttonLocator)
|
|
33
|
-
I.click(label, this.footer)
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
waitForVisible () {
|
|
37
|
-
// wait for modal dialog to be visible an ready
|
|
38
|
-
I.waitForVisible(this.main)
|
|
39
|
-
I.waitForInvisible(locate('.modal:not(.hidden):not(.modal-paused)').find('.io-ox-busy').as('Modal Busy'), 30)
|
|
40
|
-
}
|
|
41
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright Copyright (c) Open-Xchange GmbH, Germany <info@open-xchange.com>
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
*
|
|
5
|
-
* This code is free software: you can redistribute it and/or modify
|
|
6
|
-
* it under the terms of the GNU Affero General Public License as published by
|
|
7
|
-
* the Free Software Foundation, either version 3 of the License, or
|
|
8
|
-
* (at your option) any later version.
|
|
9
|
-
*
|
|
10
|
-
* This program is distributed in the hope that it will be useful,
|
|
11
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
-
* GNU Affero General Public License for more details.
|
|
14
|
-
*
|
|
15
|
-
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
-
* along with OX App Suite. If not, see <https://www.gnu.org/licenses/agpl-3.0.txt>.
|
|
17
|
-
*
|
|
18
|
-
* Any use of the work other than as authorized under this license or copyright law is prohibited.
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
const { I } = inject()
|
|
22
|
-
|
|
23
|
-
module.exports = {
|
|
24
|
-
|
|
25
|
-
searchField: locate('#io-ox-topsearch .search-field').as('Search field'),
|
|
26
|
-
dropdownToggle: locate('#io-ox-topsearch .dropdown-toggle').as('Toggle'),
|
|
27
|
-
dropdown: locate('#io-ox-topsearch .dropdown').as('Dropdown'),
|
|
28
|
-
submitButton: locate('#io-ox-topsearch .dropdown [type="submit"]').as('Submit Button'),
|
|
29
|
-
|
|
30
|
-
openDropdown () {
|
|
31
|
-
I.waitForVisible(this.dropdownToggle)
|
|
32
|
-
I.click(this.dropdownToggle)
|
|
33
|
-
I.waitForVisible(this.dropdown)
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
// introducing methods
|
|
37
|
-
doSearch (query) {
|
|
38
|
-
I.waitForElement('#io-ox-topsearch .search-field')
|
|
39
|
-
I.waitForVisible('#io-ox-topsearch .search-field')
|
|
40
|
-
I.fillField('#io-ox-topsearch .search-field', query)
|
|
41
|
-
I.fillField('#io-ox-topsearch .search-field', query)
|
|
42
|
-
I.pressKey('Enter')
|
|
43
|
-
I.waitForText('Search results')
|
|
44
|
-
I.waitToHide('.list-view .busy-indicator.io-ox-busy')
|
|
45
|
-
},
|
|
46
|
-
|
|
47
|
-
cancel () {
|
|
48
|
-
I.click(this.searchField)
|
|
49
|
-
I.clearField(this.searchField)
|
|
50
|
-
I.pressKey('Enter')
|
|
51
|
-
I.waitForInvisible('Search results')
|
|
52
|
-
I.wait(0.5)
|
|
53
|
-
}
|
|
54
|
-
}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright Copyright (c) Open-Xchange GmbH, Germany <info@open-xchange.com>
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
*
|
|
5
|
-
* This code is free software: you can redistribute it and/or modify
|
|
6
|
-
* it under the terms of the GNU Affero General Public License as published by
|
|
7
|
-
* the Free Software Foundation, either version 3 of the License, or
|
|
8
|
-
* (at your option) any later version.
|
|
9
|
-
*
|
|
10
|
-
* This program is distributed in the hope that it will be useful,
|
|
11
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
-
* GNU Affero General Public License for more details.
|
|
14
|
-
*
|
|
15
|
-
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
-
* along with OX App Suite. If not, see <https://www.gnu.org/licenses/agpl-3.0.txt>.
|
|
17
|
-
*
|
|
18
|
-
* Any use of the work other than as authorized under this license or copyright law is prohibited.
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
const { I, dialogs, settings } = inject()
|
|
22
|
-
|
|
23
|
-
module.exports = {
|
|
24
|
-
|
|
25
|
-
section: '.io-ox-mailfilter-settings .settings-explanation',
|
|
26
|
-
dialog: locate('.modal[data-point="io.ox/settings/mailfilter/filter/settings/detail/dialog"]').as('Create/Edit dialog'),
|
|
27
|
-
lastaction: locate('.io-ox-mailfilter-edit .actions > li:last-of-type').as('Last action'),
|
|
28
|
-
|
|
29
|
-
// there are so many tests doing this (also slightly differently)
|
|
30
|
-
async openRules () {
|
|
31
|
-
await settings.open('Mail', 'Rules')
|
|
32
|
-
I.waitForElement(this.section)
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
async newRule (name) {
|
|
36
|
-
I.waitForText('Add new rule')
|
|
37
|
-
I.click('Add new rule')
|
|
38
|
-
I.waitForVisible(this.dialog)
|
|
39
|
-
await I.waitForFocus('[name="rulename"]')
|
|
40
|
-
I.see('Create new rule')
|
|
41
|
-
I.see('This rule applies to all messages. Please add a condition to restrict this rule to specific messages.')
|
|
42
|
-
I.see('Please define at least one action.')
|
|
43
|
-
// set rulename
|
|
44
|
-
I.fillField('rulename', name)
|
|
45
|
-
},
|
|
46
|
-
|
|
47
|
-
addCondition (condition, value, field = 'values') {
|
|
48
|
-
I.click('Add condition')
|
|
49
|
-
I.clickDropdown(condition)
|
|
50
|
-
I.waitForDetached('.dropdown.open')
|
|
51
|
-
I.fillField(field, value)
|
|
52
|
-
},
|
|
53
|
-
|
|
54
|
-
addSubjectCondition (value) {
|
|
55
|
-
I.click('Add condition')
|
|
56
|
-
I.clickDropdown('Subject')
|
|
57
|
-
I.waitForDetached('.dropdown.open')
|
|
58
|
-
I.fillField('values', value)
|
|
59
|
-
},
|
|
60
|
-
|
|
61
|
-
addSimpleAction (label) {
|
|
62
|
-
I.click('Add action')
|
|
63
|
-
I.clickDropdown(label)
|
|
64
|
-
I.waitForDetached('.dropdown.open')
|
|
65
|
-
},
|
|
66
|
-
|
|
67
|
-
addAction (label, value) {
|
|
68
|
-
I.click('Add action')
|
|
69
|
-
I.clickDropdown(label)
|
|
70
|
-
I.waitForDetached('.dropdown.open')
|
|
71
|
-
I.fillField(this.lastaction.find('input[name]'), value)
|
|
72
|
-
},
|
|
73
|
-
|
|
74
|
-
setFlag (flag) {
|
|
75
|
-
I.click('Add action')
|
|
76
|
-
I.clickDropdown('Set color flag')
|
|
77
|
-
I.waitForDetached('.dropdown.open')
|
|
78
|
-
I.waitForVisible('~Set color')
|
|
79
|
-
I.click('~Set color')
|
|
80
|
-
|
|
81
|
-
I.waitForVisible('.flag-dropdown')
|
|
82
|
-
I.click(flag, '.flag-dropdown')
|
|
83
|
-
},
|
|
84
|
-
|
|
85
|
-
save () {
|
|
86
|
-
dialogs.clickButton('Save')
|
|
87
|
-
I.waitForDetached(this.dialog)
|
|
88
|
-
I.waitForVisible('.settings-detail-pane li.settings-list-item[data-id="0"]')
|
|
89
|
-
}
|
|
90
|
-
}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright Copyright (c) Open-Xchange GmbH, Germany <info@open-xchange.com>
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
*
|
|
5
|
-
* This code is free software: you can redistribute it and/or modify
|
|
6
|
-
* it under the terms of the GNU Affero General Public License as published by
|
|
7
|
-
* the Free Software Foundation, either version 3 of the License, or
|
|
8
|
-
* (at your option) any later version.
|
|
9
|
-
*
|
|
10
|
-
* This program is distributed in the hope that it will be useful,
|
|
11
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
-
* GNU Affero General Public License for more details.
|
|
14
|
-
*
|
|
15
|
-
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
-
* along with OX App Suite. If not, see <https://www.gnu.org/licenses/agpl-3.0.txt>.
|
|
17
|
-
*
|
|
18
|
-
* Any use of the work other than as authorized under this license or copyright law is prohibited.
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
const { I } = inject()
|
|
22
|
-
|
|
23
|
-
function getPageTitle (page) {
|
|
24
|
-
if (page === 'General') return 'core'
|
|
25
|
-
if (page === 'Drive') return 'files'
|
|
26
|
-
if (page === 'Download personal data') return 'personaldata'
|
|
27
|
-
if (page === 'Accounts') return 'io.ox/settings/accounts'
|
|
28
|
-
return page.toLocaleLowerCase()
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
module.exports = {
|
|
32
|
-
/**
|
|
33
|
-
* Opens a new settings page in the virtual settings editor.
|
|
34
|
-
*
|
|
35
|
-
* @async
|
|
36
|
-
* @param {string} [page='general'] - The name of the settings page to open.
|
|
37
|
-
* @param {string} [section=''] - The name of the settings section to open.
|
|
38
|
-
*/
|
|
39
|
-
async open (page = '', section = '') {
|
|
40
|
-
page = getPageTitle(page)
|
|
41
|
-
|
|
42
|
-
I.executeScript(async (page) => {
|
|
43
|
-
const { default: ox } = await import(String(new URL('ox.js', location.href)))
|
|
44
|
-
|
|
45
|
-
if (!page) page = ox.ui.App.getCurrentApp().get('id')
|
|
46
|
-
page = ox.ui.App.getByCid(`io.ox/${page}`) ? `io.ox/${page}` : page
|
|
47
|
-
page = page === 'core' ? 'io.ox/core' : page
|
|
48
|
-
const { default: openSettings } = await import(String(new URL('io.ox/settings/util.js', location.href)))
|
|
49
|
-
await openSettings(`virtual/settings/${page}`)
|
|
50
|
-
}, page)
|
|
51
|
-
await I.waitForApp()
|
|
52
|
-
if (section) return this.expandSection(section)
|
|
53
|
-
},
|
|
54
|
-
|
|
55
|
-
close () {
|
|
56
|
-
I.waitForElement('.settings-detail-pane .close-settings')
|
|
57
|
-
I.click('.settings-detail-pane .close-settings')
|
|
58
|
-
I.waitForDetached('.settings-detail-pane')
|
|
59
|
-
},
|
|
60
|
-
|
|
61
|
-
expandSection (title) {
|
|
62
|
-
const locator = locate('summary').withText(title).inside('.settings-detail-pane .expandable-section').as(`Expandable section "${title}"`)
|
|
63
|
-
I.waitForText(title, undefined, '.settings-detail-pane')
|
|
64
|
-
I.waitForElement(locator)
|
|
65
|
-
I.click(locator)
|
|
66
|
-
|
|
67
|
-
// wait for expanded section
|
|
68
|
-
const expanded = locate('summary').withText(title).inside('.settings-detail-pane .expandable-section[open]').as(`Expandable section "${title}" (expanded)`)
|
|
69
|
-
I.waitForElement(expanded)
|
|
70
|
-
}
|
|
71
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright Copyright (c) Open-Xchange GmbH, Germany <info@open-xchange.com>
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
*
|
|
5
|
-
* This code is free software: you can redistribute it and/or modify
|
|
6
|
-
* it under the terms of the GNU Affero General Public License as published by
|
|
7
|
-
* the Free Software Foundation, either version 3 of the License, or
|
|
8
|
-
* (at your option) any later version.
|
|
9
|
-
*
|
|
10
|
-
* This program is distributed in the hope that it will be useful,
|
|
11
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
-
* GNU Affero General Public License for more details.
|
|
14
|
-
*
|
|
15
|
-
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
-
* along with OX App Suite. If not, see <https://www.gnu.org/licenses/agpl-3.0.txt>.
|
|
17
|
-
*
|
|
18
|
-
* Any use of the work other than as authorized under this license or copyright law is prohibited.
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
const { I } = inject()
|
|
22
|
-
|
|
23
|
-
module.exports = {
|
|
24
|
-
attachInlineImage (path) {
|
|
25
|
-
const inputId = 'temp_input_for_tinymce'
|
|
26
|
-
I.executeScript(function (id) {
|
|
27
|
-
const el = document.createElement('input')
|
|
28
|
-
el.setAttribute('type', 'file')
|
|
29
|
-
el.setAttribute('id', id)
|
|
30
|
-
document.getElementsByTagName('body')[0].appendChild(el)
|
|
31
|
-
el.onchange = function () {
|
|
32
|
-
// @ts-ignore
|
|
33
|
-
window.tinyMCE.activeEditor.uploadBlob(el.files[0])
|
|
34
|
-
el.remove()
|
|
35
|
-
}
|
|
36
|
-
}, inputId)
|
|
37
|
-
// not sure why, but it takes a little to be able to attach files here.
|
|
38
|
-
I.wait(0.5)
|
|
39
|
-
I.attachFile(`#${inputId}`, path)
|
|
40
|
-
}
|
|
41
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright Copyright (c) Open-Xchange GmbH, Germany <info@open-xchange.com>
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
*
|
|
5
|
-
* This code is free software: you can redistribute it and/or modify
|
|
6
|
-
* it under the terms of the GNU Affero General Public License as published by
|
|
7
|
-
* the Free Software Foundation, either version 3 of the License, or
|
|
8
|
-
* (at your option) any later version.
|
|
9
|
-
*
|
|
10
|
-
* This program is distributed in the hope that it will be useful,
|
|
11
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
-
* GNU Affero General Public License for more details.
|
|
14
|
-
*
|
|
15
|
-
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
-
* along with OX App Suite. If not, see <https://www.gnu.org/licenses/agpl-3.0.txt>.
|
|
17
|
-
*
|
|
18
|
-
* Any use of the work other than as authorized under this license or copyright law is prohibited.
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
const { I } = inject()
|
|
22
|
-
|
|
23
|
-
module.exports = {
|
|
24
|
-
|
|
25
|
-
// new connect your device wizard, see OXUI-793
|
|
26
|
-
connectDeviceWizard () {
|
|
27
|
-
I.waitForElement('#io-ox-topbar-settings-dropdown-icon button', 30)
|
|
28
|
-
I.wait(1)
|
|
29
|
-
I.click('#io-ox-topbar-settings-dropdown-icon button')
|
|
30
|
-
I.waitForVisible(locate('a').withText('Connect your device').inside('.dropdown.open').as('Connect your device'))
|
|
31
|
-
I.click(locate('a').withText('Connect your device').inside('.dropdown.open').as('Connect your device'))
|
|
32
|
-
I.waitForVisible('.wizard-step')
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
help () {
|
|
36
|
-
I.waitForElement('#io-ox-topbar-help-dropdown-icon')
|
|
37
|
-
I.click('#io-ox-topbar-help-dropdown-icon .dropdown-toggle')
|
|
38
|
-
I.waitForElement('#topbar-help-dropdown .io-ox-context-help')
|
|
39
|
-
I.click('#topbar-help-dropdown .io-ox-context-help')
|
|
40
|
-
I.waitForElement('.io-ox-help-window')
|
|
41
|
-
I.waitForVisible('.inline-help-iframe', 10)
|
|
42
|
-
}
|
|
43
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright Copyright (c) Open-Xchange GmbH, Germany <info@open-xchange.com>
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
*
|
|
5
|
-
* This code is free software: you can redistribute it and/or modify
|
|
6
|
-
* it under the terms of the GNU Affero General Public License as published by
|
|
7
|
-
* the Free Software Foundation, either version 3 of the License, or
|
|
8
|
-
* (at your option) any later version.
|
|
9
|
-
*
|
|
10
|
-
* This program is distributed in the hope that it will be useful,
|
|
11
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
-
* GNU Affero General Public License for more details.
|
|
14
|
-
*
|
|
15
|
-
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
-
* along with OX App Suite. If not, see <https://www.gnu.org/licenses/agpl-3.0.txt>.
|
|
17
|
-
*
|
|
18
|
-
* Any use of the work other than as authorized under this license or copyright law is prohibited.
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
const { I } = inject()
|
|
22
|
-
|
|
23
|
-
module.exports = {
|
|
24
|
-
|
|
25
|
-
async scrollTo (x = null, y = null) {
|
|
26
|
-
await I.executeScript(({ x, y }) => {
|
|
27
|
-
document.querySelector('.io-ox-pdf-container.scrollable').scrollTo(x, y)
|
|
28
|
-
}, { x, y })
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
async grabTextAtPoint (x = null, y = null) {
|
|
32
|
-
return await I.executeScript(({ x, y }) => {
|
|
33
|
-
return document.elementFromPoint(x, y).textContent
|
|
34
|
-
}, { x, y })
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
async grabScrollPosition () {
|
|
38
|
-
return await I.executeScript(() => { return document.querySelector('.io-ox-pdf-container.scrollable').scrollTop })
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
async clickAtPosition (x = null, y = null) {
|
|
42
|
-
return await I.executeScript(({ x, y }) => {
|
|
43
|
-
return document.elementFromPoint(x, y).click()
|
|
44
|
-
}, { x, y })
|
|
45
|
-
},
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Set a browser selection.
|
|
49
|
-
* @param {string} startText - The 'innerText' of the node that starts the selection.
|
|
50
|
-
* @param {string} endText - The 'innerText' of the node that ends the selection.
|
|
51
|
-
* @param {string} wrapperClass - The selection is searched inside the wrapper. Provide a class name ('.className') for it.
|
|
52
|
-
* *
|
|
53
|
-
* Using the recommended workaround by pupeteer(v20.30) to select text.
|
|
54
|
-
* "dragging and selecting text is not possible using page.mouse"
|
|
55
|
-
* https://pptr.dev/api/puppeteer.mouse#example-1
|
|
56
|
-
*/
|
|
57
|
-
async setBrowserSelection (startText, endText, wrapperClass) {
|
|
58
|
-
await I.executeScript(({ startText, endText, wrapperClass }) => {
|
|
59
|
-
const selection = window.getSelection()
|
|
60
|
-
const range = document.createRange()
|
|
61
|
-
range.setStartBefore([...document.querySelectorAll(`${wrapperClass} *`)].filter(node => node.innerText.includes(startText))[0])
|
|
62
|
-
range.setEndAfter([...document.querySelectorAll(`${wrapperClass} *`)].filter(node => node.innerText.includes(endText))[0])
|
|
63
|
-
selection.removeAllRanges()
|
|
64
|
-
selection.addRange(range)
|
|
65
|
-
}, { startText, endText, wrapperClass })
|
|
66
|
-
}
|
|
67
|
-
}
|
package/src/pageobjects/mail.js
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright Copyright (c) Open-Xchange GmbH, Germany <info@open-xchange.com>
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
*
|
|
5
|
-
* This code is free software: you can redistribute it and/or modify
|
|
6
|
-
* it under the terms of the GNU Affero General Public License as published by
|
|
7
|
-
* the Free Software Foundation, either version 3 of the License, or
|
|
8
|
-
* (at your option) any later version.
|
|
9
|
-
*
|
|
10
|
-
* This program is distributed in the hope that it will be useful,
|
|
11
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
-
* GNU Affero General Public License for more details.
|
|
14
|
-
*
|
|
15
|
-
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
-
* along with OX App Suite. If not, see <https://www.gnu.org/licenses/agpl-3.0.txt>.
|
|
17
|
-
*
|
|
18
|
-
* Any use of the work other than as authorized under this license or copyright law is prohibited.
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
const { I } = inject()
|
|
22
|
-
|
|
23
|
-
module.exports = {
|
|
24
|
-
|
|
25
|
-
composeWindow: '.io-ox-mail-compose-window',
|
|
26
|
-
editorIframe: '.io-ox-mail-compose-window .editor iframe',
|
|
27
|
-
to: '.to .tt-input',
|
|
28
|
-
subject: '.mail-input [name="subject"]',
|
|
29
|
-
editorText: '.editor .plain-text',
|
|
30
|
-
|
|
31
|
-
async selectMail (text, selector) {
|
|
32
|
-
const titleSelector = `.list-item[aria-label*="${text}"]`
|
|
33
|
-
const senderSelector = locate('.list-view .person').withText(text).as('Mail sender')
|
|
34
|
-
const item = selector === 'Sender' ? senderSelector : titleSelector
|
|
35
|
-
I.waitForElement(item, 60)
|
|
36
|
-
I.wait(1)
|
|
37
|
-
I.click(item)
|
|
38
|
-
await I.waitForFocus('.list-view li.list-item.selected')
|
|
39
|
-
},
|
|
40
|
-
async selectMailByIndex (index) {
|
|
41
|
-
const item = locate('.list-view li.list-item').withAttr({ 'data-index': index.toString() }).as('Mail item')
|
|
42
|
-
I.waitForElement(item)
|
|
43
|
-
I.wait(0.5)
|
|
44
|
-
I.click(item)
|
|
45
|
-
await I.waitForFocus('.list-view li.list-item.selected')
|
|
46
|
-
},
|
|
47
|
-
async newMail () {
|
|
48
|
-
I.clickPrimary('New email')
|
|
49
|
-
I.waitForVisible('.active .io-ox-mail-compose [placeholder="To"]', 30)
|
|
50
|
-
await I.waitForFocus('.active .io-ox-mail-compose [placeholder="To"]')
|
|
51
|
-
I.waitForInvisible('.active.io-ox-mail-compose-window .window-blocker', 30)
|
|
52
|
-
},
|
|
53
|
-
addAttachment (path) {
|
|
54
|
-
I.click('~Attachments')
|
|
55
|
-
const ext = path.match(/\.(.{3,4})$/)[1]
|
|
56
|
-
I.attachFile({ css: 'input[type=file]' }, path)
|
|
57
|
-
I.pressKey('Escape')
|
|
58
|
-
I.waitForText(ext, 30, '.attachment-list.preview .fallback')
|
|
59
|
-
},
|
|
60
|
-
send () {
|
|
61
|
-
I.click('Send')
|
|
62
|
-
I.wait(0.5)
|
|
63
|
-
I.waitToHide('.io-ox-mail-compose-window')
|
|
64
|
-
I.waitToHide('.mail-send-progress', 45)
|
|
65
|
-
}
|
|
66
|
-
}
|