aboutsummaryrefslogtreecommitdiffstats
path: root/tests/ui-regression/test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui-regression/test')
-rw-r--r--tests/ui-regression/test/appsSpec.js60
-rw-r--r--tests/ui-regression/test/filesSpec.js102
-rw-r--r--tests/ui-regression/test/installSpec.js76
-rw-r--r--tests/ui-regression/test/loginSpec.js81
-rw-r--r--tests/ui-regression/test/publicSpec.js102
-rw-r--r--tests/ui-regression/test/settingsSpec.js76
6 files changed, 497 insertions, 0 deletions
diff --git a/tests/ui-regression/test/appsSpec.js b/tests/ui-regression/test/appsSpec.js
new file mode 100644
index 00000000000..3a23c1df773
--- /dev/null
+++ b/tests/ui-regression/test/appsSpec.js
@@ -0,0 +1,60 @@
+/**
+ * @copyright 2018 Julius Härtl <jus@bitgrid.net>
+ *
+ * @author 2018 Julius Härtl <jus@bitgrid.net>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+const helper = require('../helper.js');
+const config = require('../config.js');
+
+describe('apps', function () {
+
+ before(async () => {
+ await helper.init(this)
+ await helper.login(this)
+ });
+ after(async () => await helper.exit());
+
+ config.resolutions.forEach(function (resolution) {
+ it('apps.' + resolution.title, async function () {
+ return helper.takeAndCompare(this, 'index.php/settings/apps', async function (page) {
+ await page.waitForSelector('#apps-list .section', {timeout: 5000});
+ await page.waitFor(500);
+ }, {viewport: resolution, waitUntil: 'networkidle2'});
+ });
+
+ ['your-apps', 'enabled', 'disabled', 'app-bundles'].forEach(function(endpoint) {
+ it('apps.' + endpoint + '.' + resolution.title, async function () {
+ return helper.takeAndCompare(this, undefined, async function (page) {
+ try {
+ await page.waitForSelector('#app-navigation-toggle', {
+ visible: true,
+ timeout: 1000,
+ }).then((element) => element.click())
+ } catch (err) {}
+ await helper.delay(500);
+ await page.click('li#app-category-' + endpoint + ' a');
+ await helper.delay(500);
+ await page.waitForSelector('#app-content:not(.icon-loading)');
+ }, {viewport: resolution});
+ });
+ });
+ });
+
+});
diff --git a/tests/ui-regression/test/filesSpec.js b/tests/ui-regression/test/filesSpec.js
new file mode 100644
index 00000000000..7a029b2f311
--- /dev/null
+++ b/tests/ui-regression/test/filesSpec.js
@@ -0,0 +1,102 @@
+/**
+ * @copyright 2018 Julius Härtl <jus@bitgrid.net>
+ *
+ * @author 2018 Julius Härtl <jus@bitgrid.net>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+const puppeteer = require('puppeteer');
+const helper = require('../helper.js');
+const config = require('../config.js');
+
+describe('files', function () {
+
+ before(async () => {
+ await helper.init(this)
+ await helper.login(this)
+ });
+ after(async () => await helper.exit());
+
+ config.resolutions.forEach(function (resolution) {
+
+ it('file-sidebar-share.' + resolution.title, async function () {
+ return helper.takeAndCompare(this, 'index.php/apps/files', async function (page) {
+ let element = await page.$('[data-file="welcome.txt"] .action-share');
+ await element.click('[data-file="welcome.txt"] .action-share');
+ await page.waitForSelector('.shareWithField');
+ await helper.delay(500);
+ await page.$eval('body', e => { $('.shareWithField').blur() });
+ }, {viewport: resolution});
+ });
+ it('file-popover.' + resolution.title, async function () {
+ return helper.takeAndCompare(this, 'index.php/apps/files', async function (page) {
+ await page.click('[data-file=\'welcome.txt\'] .action-menu');
+ await page.waitForSelector('.fileActionsMenu');
+ }, {viewport: resolution});
+ });
+ it('file-sidebar-details.' + resolution.title, async function() {
+ return helper.takeAndCompare(this, undefined, async function (page) {
+ await page.click('[data-file=\'welcome.txt\'] .fileActionsMenu [data-action=\'Details\']');
+ await page.waitForSelector('[data-tabid=\'commentsTabView\']');
+ await page.$eval('body', e => { $('.shareWithField').blur() });
+ await helper.delay(500); // wait for animation
+ }, {viewport: resolution});
+ });
+ it('file-sidebar-details-sharing.' + resolution.title, async function() {
+ return helper.takeAndCompare(this, undefined, async function (page) {
+ let tab = await helper.childOfClassByText(page, 'tabHeaders', 'Sharing');
+ tab[0].click();
+ await page.waitForSelector('input.shareWithField');
+ await page.$eval('body', e => { $('.shareWithField').blur() });
+ await helper.delay(500); // wait for animation
+ }, {viewport: resolution});
+ });
+ it('file-sidebar-details-versions.' + resolution.title, async function() {
+ return helper.takeAndCompare(this, undefined, async function (page) {
+ let tab = await helper.childOfClassByText(page, 'tabHeaders', 'Versions');
+ tab[0].click();
+ await helper.delay(100); // wait for animation
+ }, {viewport: resolution});
+ });
+ it('file-popover.favorite.' + resolution.title, async function () {
+ return helper.takeAndCompare(this, 'index.php/apps/files', async function (page) {
+ await page.click('[data-file=\'welcome.txt\'] .action-menu');
+ await page.waitForSelector('.fileActionsMenu')
+ await page.click('[data-file=\'welcome.txt\'] .fileActionsMenu [data-action=\'Favorite\']');;
+ }, {viewport: resolution});
+ });
+
+ it('file-favorites.' + resolution.title, async function () {
+ return helper.takeAndCompare(this, 'index.php/apps/files', async function (page) {
+ try {
+ await page.waitForSelector('#app-navigation-toggle', {
+ visible: true,
+ timeout: 1000,
+ }).then((element) => element.click())
+ } catch (err) {}
+ await page.click('#app-navigation [data-id=\'favorites\'] a');
+ await helper.delay(500); // wait for animation
+ }, {viewport: resolution});
+ });
+
+
+ });
+
+
+
+});
diff --git a/tests/ui-regression/test/installSpec.js b/tests/ui-regression/test/installSpec.js
new file mode 100644
index 00000000000..ffb4854f1b6
--- /dev/null
+++ b/tests/ui-regression/test/installSpec.js
@@ -0,0 +1,76 @@
+/**
+ * @copyright 2018 Julius Härtl <jus@bitgrid.net>
+ *
+ * @author 2018 Julius Härtl <jus@bitgrid.net>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+const helper = require('../helper.js');
+const config = require('../config.js');
+
+describe('install', function () {
+
+ before(async () => await helper.init(this));
+ after(async () => await helper.exit());
+
+ config.resolutions.forEach(function (resolution) {
+ it('show-page.' + resolution.title, async function () {
+ // (test, route, prepare, action, options
+ return helper.takeAndCompare(this, 'index.php', async (page) => {
+ await helper.delay(100);
+ await page.$eval('body', function (e) {
+ $('#adminlogin').blur();
+ });
+ await helper.delay(100);
+ }, { waitUntil: 'networkidle0', viewport: resolution});
+ });
+
+ it('show-advanced.' + resolution.title, async function () {
+ // (test, route, prepare, action, options
+ return helper.takeAndCompare(this, undefined, async (page) => {
+ await page.click('#showAdvanced');
+ await helper.delay(300);
+ }, { waitUntil: 'networkidle0', viewport: resolution});
+ });
+ it('show-advanced-mysql.' + resolution.title, async function () {
+ // (test, route, prepare, action, options
+ return helper.takeAndCompare(this, undefined, async (page) => {
+ await page.click('label.mysql');
+ await helper.delay(300);
+ }, { waitUntil: 'networkidle0', viewport: resolution});
+ });
+ });
+
+ it('runs', async function () {
+ this.timeout(5*60*1000);
+ helper.pageBase.setDefaultNavigationTimeout(5*60*1000);
+ helper.pageCompare.setDefaultNavigationTimeout(5*60*1000);
+ // just run for one resolution since we can only install once
+ return helper.takeAndCompare(this, 'index.php', async function (page) {
+ const login = await page.type('#adminlogin', 'admin');
+ const password = await page.type('#adminpass', 'admin');
+ const inputElement = await page.$('input[type=submit]');
+ await inputElement.click();
+ await page.waitForNavigation({waitUntil: 'networkidle2'});
+ await page.waitForSelector('#header');
+ helper.pageBase.setDefaultNavigationTimeout(60000);
+ helper.pageCompare.setDefaultNavigationTimeout(60000);
+ }, { waitUntil: 'networkidle0', viewport: {w: 1920, h: 1080}});
+ });
+
+});
diff --git a/tests/ui-regression/test/loginSpec.js b/tests/ui-regression/test/loginSpec.js
new file mode 100644
index 00000000000..8607bbabc84
--- /dev/null
+++ b/tests/ui-regression/test/loginSpec.js
@@ -0,0 +1,81 @@
+/**
+ * @copyright 2018 Julius Härtl <jus@bitgrid.net>
+ *
+ * @author 2018 Julius Härtl <jus@bitgrid.net>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+const helper = require('../helper.js');
+const config = require('../config.js');
+
+describe('login', function () {
+
+ before(async () => await helper.init(this));
+ after(async () => await helper.exit());
+
+ /**
+ * Test login page rendering
+ */
+ config.resolutions.forEach(function (resolution) {
+ it('login-page.' + resolution.title, async function () {
+ return helper.takeAndCompare(this, '/', async (page) => {
+ // make sure the cursor is not blinking in the login field
+ await page.$eval('body', function (e) {
+ $('#user').blur();
+ });
+ return await helper.delay(100);
+ }, {viewport: resolution});
+ });
+
+ it('login-page.forgot.' + resolution.title, async function () {
+ return helper.takeAndCompare(this, undefined, async (page) => {
+ const lostPassword = await page.$('#lost-password');
+ await lostPassword.click();
+ await helper.delay(500);
+ await page.$eval('body', function (e) {
+ $('#user').blur();
+ });
+ }, {viewport: resolution});
+ });
+ });
+
+ /**
+ * Perform login
+ */
+ config.resolutions.forEach(function (resolution) {
+ it('login-success.' + resolution.title, async function () {
+ this.timeout(30000);
+ await helper.resetBrowser();
+ return helper.takeAndCompare(this, '/', async function (page) {
+ await page.waitForSelector('input#user');
+ await page.type('#user', 'admin');
+ await page.type('#password', 'admin');
+ const inputElement = await page.$('input[type=submit]');
+ await inputElement.click();
+ await page.waitForNavigation({waitUntil: 'networkidle2'});
+ await page.waitForSelector('#header');
+ await page.$eval('body', function (e) {
+ // force relative timestamp to fixed value, since it breaks screenshot diffing
+ $('.live-relative-timestamp').removeClass('live-relative-timestamp').text('5 minutes ago');
+ });
+ return await helper.delay(100);
+ }, {viewport: resolution});
+ })
+ });
+
+});
diff --git a/tests/ui-regression/test/publicSpec.js b/tests/ui-regression/test/publicSpec.js
new file mode 100644
index 00000000000..0893adf9a42
--- /dev/null
+++ b/tests/ui-regression/test/publicSpec.js
@@ -0,0 +1,102 @@
+/**
+ * @copyright 2018 Julius Härtl <jus@bitgrid.net>
+ *
+ * @author 2018 Julius Härtl <jus@bitgrid.net>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+const puppeteer = require('puppeteer');
+const helper = require('../helper.js');
+const config = require('../config.js');
+
+describe('public', function () {
+
+ before(async () => {
+ await helper.init(this)
+ await helper.login(this)
+ });
+ after(async () => await helper.exit());
+
+ /**
+ * Test invalid file share rendering
+ */
+ config.resolutions.forEach(function (resolution) {
+ it('file-share-invalid.' + resolution.title, async function () {
+ return helper.takeAndCompare(this, 'index.php/s/invalid', async function () {
+ }, {waitUntil: 'networkidle2', viewport: resolution});
+ });
+ });
+
+ /**
+ * Share a file via public link
+ */
+
+ var shareLink = {};
+ it('file-share-link', async function () {
+ return helper.takeAndCompare(this, 'index.php/apps/files', async function (page) {
+ const element = await page.$('[data-file="welcome.txt"] .action-share');
+ await element.click('[data-file="welcome.txt"] .action-share');
+ await page.waitForSelector('input.linkCheckbox');
+ const linkCheckbox = await page.$('.linkShareView label');
+ await Promise.all([
+ linkCheckbox.click(),
+ page.waitForSelector('.linkText')
+ ]);
+ await helper.delay(500);
+ const text = await page.waitForSelector('.linkText');
+ const link = await (await text.getProperty('value')).jsonValue();
+ shareLink[page.url()] = link;
+ return await helper.delay(500);
+ }, {
+ runOnly: true,
+ waitUntil: 'networkidle2',
+ viewport: {w: 1920, h: 1080}
+ });
+ });
+
+ config.resolutions.forEach(function (resolution) {
+ it('file-share-valid.' + resolution.title, async function () {
+ return helper.takeAndCompare(this, 'index.php/apps/files', async function (page) {
+ await page.goto(shareLink[page.url()]);
+ await helper.delay(500);
+ }, {waitUntil: 'networkidle2', viewport: resolution});
+ });
+ it('file-share-valid-actions.' + resolution.title, async function () {
+ return helper.takeAndCompare(this, undefined, async function (page) {
+ const moreButton = await page.waitForSelector('#header-secondary-action');
+ await moreButton.click();
+ await page.evaluate((data) => {
+ return document.querySelector('#directLink').value = 'http://nextcloud.example.com/';
+ });
+ await helper.delay(500);
+ }, {waitUntil: 'networkidle2', viewport: resolution});
+ });
+ });
+
+ it('file-unshare', async function () {
+ return helper.takeAndCompare(this, 'index.php/apps/files', async function (page) {
+ const element = await page.$('[data-file="welcome.txt"] .action-share');
+ await element.click('[data-file="welcome.txt"] .action-share');
+ await page.waitForSelector('input.linkCheckbox');
+ const linkCheckbox = await page.$('.linkShareView label');
+ await linkCheckbox.click();
+ await helper.delay(500);
+ }, { waitUntil: 'networkidle2', viewport: {w: 1920, h:1080}});
+ });
+
+});
diff --git a/tests/ui-regression/test/settingsSpec.js b/tests/ui-regression/test/settingsSpec.js
new file mode 100644
index 00000000000..8b10b281fb6
--- /dev/null
+++ b/tests/ui-regression/test/settingsSpec.js
@@ -0,0 +1,76 @@
+/**
+ * @copyright 2018 Julius Härtl <jus@bitgrid.net>
+ *
+ * @author 2018 Julius Härtl <jus@bitgrid.net>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+const helper = require('../helper.js');
+const config = require('../config.js');
+
+describe('settings', function () {
+
+ before(async () => {
+ await helper.init(this)
+ await helper.login(this)
+ });
+ after(async () => await helper.exit());
+
+ config.resolutions.forEach(function (resolution) {
+ it('personal.' + resolution.title, async function () {
+ return helper.takeAndCompare(this, 'index.php/settings/user', async function (page) {
+ }, {viewport: resolution});
+ });
+
+ it('admin.' + resolution.title, async function () {
+ return helper.takeAndCompare(this, 'index.php/settings/admin', async function (page) {
+ }, {viewport: resolution});
+ });
+
+ ['sharing', 'security', 'theming', 'encryption', 'additional', 'tips-tricks'].forEach(function(endpoint) {
+ it('admin.' + endpoint + '.' + resolution.title, async function () {
+ return helper.takeAndCompare(this, 'index.php/settings/admin/' + endpoint, async function (page) {
+ }, {viewport: resolution, waitUntil: 'networkidle2'});
+ });
+ });
+
+ it('usermanagement.' + resolution.title, async function () {
+ return helper.takeAndCompare(this, 'index.php/settings/users', async function (page) {
+ }, {viewport: resolution});
+ });
+
+ it('usermanagement.add.' + resolution.title, async function () {
+ return helper.takeAndCompare(this, undefined, async function (page) {
+ try {
+ await page.waitForSelector('#app-navigation-toggle', {
+ visible: true,
+ timeout: 1000,
+ }).then((element) => element.click())
+ } catch (err) {}
+ let newUserButton = await page.waitForSelector('#new-user-button');
+ await newUserButton.click();
+ await helper.delay(200);
+ await page.$eval('body', function (e) {
+ $('#newusername').blur();
+ })
+ await helper.delay(100);
+ }, {viewport: resolution});
+ });
+
+ });
+});