appsSpec.js 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /**
  2. * @copyright 2018 Julius Härtl <jus@bitgrid.net>
  3. *
  4. * @author 2018 Julius Härtl <jus@bitgrid.net>
  5. *
  6. * @license GNU AGPL version 3 or any later version
  7. *
  8. * This program is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU Affero General Public License as
  10. * published by the Free Software Foundation, either version 3 of the
  11. * License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU Affero General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Affero General Public License
  19. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  20. *
  21. */
  22. const helper = require('../helper.js');
  23. const config = require('../config.js');
  24. describe('apps', function () {
  25. before(async () => {
  26. await helper.init(this)
  27. await helper.login(this)
  28. });
  29. after(async () => await helper.exit());
  30. config.resolutions.forEach(function (resolution) {
  31. it('apps.' + resolution.title, async function () {
  32. return helper.takeAndCompare(this, 'index.php/settings/apps', async function (page) {
  33. await page.waitForSelector('#apps-list .section', {timeout: 5000});
  34. await page.waitFor(500);
  35. }, {viewport: resolution, waitUntil: 'networkidle2'});
  36. });
  37. ['your-apps', 'enabled', 'disabled', 'app-bundles'].forEach(function(endpoint) {
  38. it('apps.' + endpoint + '.' + resolution.title, async function () {
  39. return helper.takeAndCompare(this, undefined, async function (page) {
  40. try {
  41. await page.waitForSelector('#app-navigation-toggle', {
  42. visible: true,
  43. timeout: 1000,
  44. }).then((element) => element.click())
  45. } catch (err) {}
  46. await helper.delay(500);
  47. await page.click('li#app-category-' + endpoint + ' a');
  48. await helper.delay(500);
  49. await page.waitForSelector('#app-content:not(.icon-loading)');
  50. }, {viewport: resolution});
  51. });
  52. });
  53. });
  54. });