From 1fe4fee1d9e1e26c07a8f51e5ad9b81042c13fed Mon Sep 17 00:00:00 2001 From: superaleks <47592680+superaleks@users.noreply.github.com> Date: Mon, 18 Jul 2022 15:56:21 +0200 Subject: [PATCH] [bitnami/*] Move utilities to support folder (#11164) * Added antiflake pipeline Signed-off-by: alukic * Diversified the pipeline Signed-off-by: alukic * Make a change to trigger TKG Signed-off-by: alukic * Replaced FIPS with normal AKS Signed-off-by: alukic * Added extra workflow for Grafana Loki Signed-off-by: alukic * Changed the pipeline Signed-off-by: alukic * Modified the workflow Signed-off-by: alukic * Removed Grafana Loki Signed-off-by: alukic * Reordered files Signed-off-by: alukic * Remove the pipeline Signed-off-by: alukic * Removed test files Signed-off-by: alukic * Applied changes to magento as well Signed-off-by: alukic * Moved file Signed-off-by: alukic * Corrected the wrong move Signed-off-by: alukic * Additionaly correct file movings Signed-off-by: alukic * Correction for SuiteCRM Signed-off-by: alukic --- .../cypress/integration/airflow_spec.js | 2 +- .vib/airflow/cypress/cypress/support/index.js | 2 +- .../cypress/{integration => support}/utils.js | 0 .../cypress/integration/consul_spec.js | 2 +- .../cypress/{integration => support}/utils.js | 0 .../cypress/integration/discourse_spec.js | 2 +- .../cypress/{integration => support}/utils.js | 0 .../cypress/integration/dokuwiki_spec.js | 2 +- .../cypress/{integration => support}/utils.js | 0 .../cypress/integration/elasticsearch_spec.js | 2 +- .../cypress/{integration => support}/utils.js | 0 .../cypress/cypress/integration/ghost_spec.js | 6 +- .../cypress/{integration => support}/utils.js | 0 .../cypress/integration/grafana_loki_spec.js | 2 +- .../cypress/{integration => support}/utils.js | 0 .../cypress/integration/grafana_spec.js | 2 +- .vib/grafana/cypress/cypress/support/index.js | 2 +- .../cypress/{integration => support}/utils.js | 0 .../cypress/integration/harbor_spec.js | 76 +++++++++---------- .../cypress/{integration => support}/utils.js | 0 .../cypress/integration/jenkins_spec.js | 2 +- .../cypress/{integration => support}/utils.js | 0 .../cypress/integration/joomla_spec.js | 2 +- .../cypress/{integration => support}/utils.js | 0 .../cypress/integration/keycloak_spec.js | 2 +- .../cypress/{integration => support}/utils.js | 0 .../cypress/integration/kibana_spec.js | 2 +- .../cypress/{integration => support}/utils.js | 0 .../cypress/integration/magento_spec.js | 2 +- .../cypress/{integration => support}/utils.js | 0 .../cypress/integration/matomo_spec.js | 31 ++++---- .../cypress/{integration => support}/utils.js | 0 .../cypress/integration/mediawiki_spec.js | 13 ++-- .../cypress/{integration => support}/utils.js | 0 .../cypress/cypress/integration/minio_spec.js | 2 +- .vib/minio/cypress/cypress/support/index.js | 2 +- .../cypress/{integration => support}/utils.js | 0 .../cypress/integration/opencart_spec.js | 2 +- .../cypress/{integration => support}/utils.js | 0 .../cypress/integration/owncloud_spec.js | 2 +- .../cypress/{integration => support}/utils.js | 0 .../cypress/integration/phpmyadmin_spec.js | 6 +- .../cypress/{integration => support}/utils.js | 0 .../cypress/integration/prestashop_spec.js | 2 +- .../cypress/{integration => support}/utils.js | 0 .../cypress/integration/rabbitmq_spec.js | 2 +- .../cypress/{integration => support}/utils.js | 0 .../cypress/integration/redmine_spec.js | 2 +- .../cypress/{integration => support}/utils.js | 0 .../cypress/cypress/integration/solr_spec.js | 74 +++++++++--------- .../integration/spring_cloud_dataflow_spec.js | 7 +- .../prepare_app_state.js | 0 .../cypress/{integration => support}/utils.js | 0 .../cypress/integration/suitecrm_spec.js | 2 +- .../cypress/{integration => support}/utils.js | 0 .../cypress/integration/wordpress_spec.js | 2 +- .../cypress/{integration => support}/utils.js | 0 57 files changed, 134 insertions(+), 125 deletions(-) rename .vib/airflow/cypress/cypress/{integration => support}/utils.js (100%) rename .vib/consul/cypress/cypress/{integration => support}/utils.js (100%) rename .vib/discourse/cypress/cypress/{integration => support}/utils.js (100%) rename .vib/dokuwiki/cypress/cypress/{integration => support}/utils.js (100%) rename .vib/elasticsearch/cypress/cypress/{integration => support}/utils.js (100%) rename .vib/ghost/cypress/cypress/{integration => support}/utils.js (100%) rename .vib/grafana-loki/cypress/cypress/{integration => support}/utils.js (100%) rename .vib/grafana/cypress/cypress/{integration => support}/utils.js (100%) rename .vib/harbor/cypress/cypress/{integration => support}/utils.js (100%) rename .vib/jenkins/cypress/cypress/{integration => support}/utils.js (100%) rename .vib/joomla/cypress/cypress/{integration => support}/utils.js (100%) rename .vib/keycloak/cypress/cypress/{integration => support}/utils.js (100%) rename .vib/kibana/cypress/cypress/{integration => support}/utils.js (100%) rename .vib/magento/cypress/cypress/{integration => support}/utils.js (100%) rename .vib/matomo/cypress/cypress/{integration => support}/utils.js (100%) rename .vib/mediawiki/cypress/cypress/{integration => support}/utils.js (100%) rename .vib/minio/cypress/cypress/{integration => support}/utils.js (100%) rename .vib/opencart/cypress/cypress/{integration => support}/utils.js (100%) rename .vib/owncloud/cypress/cypress/{integration => support}/utils.js (100%) rename .vib/phpmyadmin/cypress/cypress/{integration => support}/utils.js (100%) rename .vib/prestashop/cypress/cypress/{integration => support}/utils.js (100%) rename .vib/rabbitmq/cypress/cypress/{integration => support}/utils.js (100%) rename .vib/redmine/cypress/cypress/{integration => support}/utils.js (100%) rename .vib/spring-cloud-dataflow/cypress/cypress/{integration => support}/prepare_app_state.js (100%) rename .vib/spring-cloud-dataflow/cypress/cypress/{integration => support}/utils.js (100%) rename .vib/suitecrm/cypress/cypress/{integration => support}/utils.js (100%) rename .vib/wordpress/cypress/cypress/{integration => support}/utils.js (100%) diff --git a/.vib/airflow/cypress/cypress/integration/airflow_spec.js b/.vib/airflow/cypress/cypress/integration/airflow_spec.js index c06c480bbb..d863b10e29 100644 --- a/.vib/airflow/cypress/cypress/integration/airflow_spec.js +++ b/.vib/airflow/cypress/cypress/integration/airflow_spec.js @@ -1,5 +1,5 @@ /// -import { random } from './utils'; +import { random } from '../support/utils'; it('allows triggering execution of a sample DAG', () => { cy.login(); diff --git a/.vib/airflow/cypress/cypress/support/index.js b/.vib/airflow/cypress/cypress/support/index.js index d68db96df2..37a498fb5b 100644 --- a/.vib/airflow/cypress/cypress/support/index.js +++ b/.vib/airflow/cypress/cypress/support/index.js @@ -14,7 +14,7 @@ // *********************************************************** // Import commands.js using ES2015 syntax: -import './commands' +import './commands'; // Alternatively you can use CommonJS syntax: // require('./commands') diff --git a/.vib/airflow/cypress/cypress/integration/utils.js b/.vib/airflow/cypress/cypress/support/utils.js similarity index 100% rename from .vib/airflow/cypress/cypress/integration/utils.js rename to .vib/airflow/cypress/cypress/support/utils.js diff --git a/.vib/consul/cypress/cypress/integration/consul_spec.js b/.vib/consul/cypress/cypress/integration/consul_spec.js index f030883903..2dafa8f1a5 100644 --- a/.vib/consul/cypress/cypress/integration/consul_spec.js +++ b/.vib/consul/cypress/cypress/integration/consul_spec.js @@ -1,6 +1,6 @@ /// -import { random } from './utils'; +import { random } from '../support/utils'; const DATACENTER_NAME = Cypress.env('datacenterName'); const REPLICA_COUNT = Cypress.env('replicaCount'); diff --git a/.vib/consul/cypress/cypress/integration/utils.js b/.vib/consul/cypress/cypress/support/utils.js similarity index 100% rename from .vib/consul/cypress/cypress/integration/utils.js rename to .vib/consul/cypress/cypress/support/utils.js diff --git a/.vib/discourse/cypress/cypress/integration/discourse_spec.js b/.vib/discourse/cypress/cypress/integration/discourse_spec.js index 3358712ab8..2f945696f0 100644 --- a/.vib/discourse/cypress/cypress/integration/discourse_spec.js +++ b/.vib/discourse/cypress/cypress/integration/discourse_spec.js @@ -1,5 +1,5 @@ /// -import { random } from './utils'; +import { random } from '../support/utils'; it('allows to log in and out', () => { cy.login(); diff --git a/.vib/discourse/cypress/cypress/integration/utils.js b/.vib/discourse/cypress/cypress/support/utils.js similarity index 100% rename from .vib/discourse/cypress/cypress/integration/utils.js rename to .vib/discourse/cypress/cypress/support/utils.js diff --git a/.vib/dokuwiki/cypress/cypress/integration/dokuwiki_spec.js b/.vib/dokuwiki/cypress/cypress/integration/dokuwiki_spec.js index 88a08e721f..5ace428206 100644 --- a/.vib/dokuwiki/cypress/cypress/integration/dokuwiki_spec.js +++ b/.vib/dokuwiki/cypress/cypress/integration/dokuwiki_spec.js @@ -1,5 +1,5 @@ /// -import { random } from './utils'; +import { random } from '../support/utils'; it('allows login and logout', () => { cy.login(); diff --git a/.vib/dokuwiki/cypress/cypress/integration/utils.js b/.vib/dokuwiki/cypress/cypress/support/utils.js similarity index 100% rename from .vib/dokuwiki/cypress/cypress/integration/utils.js rename to .vib/dokuwiki/cypress/cypress/support/utils.js diff --git a/.vib/elasticsearch/cypress/cypress/integration/elasticsearch_spec.js b/.vib/elasticsearch/cypress/cypress/integration/elasticsearch_spec.js index 0472529fc4..76a7aee657 100644 --- a/.vib/elasticsearch/cypress/cypress/integration/elasticsearch_spec.js +++ b/.vib/elasticsearch/cypress/cypress/integration/elasticsearch_spec.js @@ -1,5 +1,5 @@ /// -import { random } from './utils'; +import { random } from '../support/utils'; import body from '../fixtures/documents.json'; const NODE_NUMBER = Cypress.env('nodeNumber'); diff --git a/.vib/elasticsearch/cypress/cypress/integration/utils.js b/.vib/elasticsearch/cypress/cypress/support/utils.js similarity index 100% rename from .vib/elasticsearch/cypress/cypress/integration/utils.js rename to .vib/elasticsearch/cypress/cypress/support/utils.js diff --git a/.vib/ghost/cypress/cypress/integration/ghost_spec.js b/.vib/ghost/cypress/cypress/integration/ghost_spec.js index 15774669da..0e317cc348 100644 --- a/.vib/ghost/cypress/cypress/integration/ghost_spec.js +++ b/.vib/ghost/cypress/cypress/integration/ghost_spec.js @@ -1,5 +1,9 @@ /// -import { random, getPageUrlFromTitle, getUserFromEmail } from './utils'; +import { + random, + getPageUrlFromTitle, + getUserFromEmail, +} from '../support/utils'; it('allows to log in and out', () => { cy.login(); diff --git a/.vib/ghost/cypress/cypress/integration/utils.js b/.vib/ghost/cypress/cypress/support/utils.js similarity index 100% rename from .vib/ghost/cypress/cypress/integration/utils.js rename to .vib/ghost/cypress/cypress/support/utils.js diff --git a/.vib/grafana-loki/cypress/cypress/integration/grafana_loki_spec.js b/.vib/grafana-loki/cypress/cypress/integration/grafana_loki_spec.js index 9f6c446e97..3b1a13048f 100644 --- a/.vib/grafana-loki/cypress/cypress/integration/grafana_loki_spec.js +++ b/.vib/grafana-loki/cypress/cypress/integration/grafana_loki_spec.js @@ -1,6 +1,6 @@ /// import body from '../fixtures/logs-body.json'; -import { lastMinuteTimestamp } from './utils'; +import { lastMinuteTimestamp } from '../support/utils'; it('shows build info endpoint', () => { cy.request({ diff --git a/.vib/grafana-loki/cypress/cypress/integration/utils.js b/.vib/grafana-loki/cypress/cypress/support/utils.js similarity index 100% rename from .vib/grafana-loki/cypress/cypress/integration/utils.js rename to .vib/grafana-loki/cypress/cypress/support/utils.js diff --git a/.vib/grafana/cypress/cypress/integration/grafana_spec.js b/.vib/grafana/cypress/cypress/integration/grafana_spec.js index c1e02847df..28fcaef338 100644 --- a/.vib/grafana/cypress/cypress/integration/grafana_spec.js +++ b/.vib/grafana/cypress/cypress/integration/grafana_spec.js @@ -1,5 +1,5 @@ /// -import { random, verifySuccesOfAction } from './utils'; +import { random, verifySuccesOfAction } from '../support/utils'; it('allows user to log in and log out', () => { cy.login(); diff --git a/.vib/grafana/cypress/cypress/support/index.js b/.vib/grafana/cypress/cypress/support/index.js index d68db96df2..37a498fb5b 100644 --- a/.vib/grafana/cypress/cypress/support/index.js +++ b/.vib/grafana/cypress/cypress/support/index.js @@ -14,7 +14,7 @@ // *********************************************************** // Import commands.js using ES2015 syntax: -import './commands' +import './commands'; // Alternatively you can use CommonJS syntax: // require('./commands') diff --git a/.vib/grafana/cypress/cypress/integration/utils.js b/.vib/grafana/cypress/cypress/support/utils.js similarity index 100% rename from .vib/grafana/cypress/cypress/integration/utils.js rename to .vib/grafana/cypress/cypress/support/utils.js diff --git a/.vib/harbor/cypress/cypress/integration/harbor_spec.js b/.vib/harbor/cypress/cypress/integration/harbor_spec.js index d84309f60a..9f4ce77581 100644 --- a/.vib/harbor/cypress/cypress/integration/harbor_spec.js +++ b/.vib/harbor/cypress/cypress/integration/harbor_spec.js @@ -1,64 +1,64 @@ /// -import { random } from "./utils"; +import { random } from '../support/utils'; -it("allows user to log in and log out", () => { +it('allows user to log in and log out', () => { cy.login(); - cy.contains("Invalid user name or password").should("not.exist"); - cy.contains("button", "admin").click(); - cy.contains("Log Out").click(); - cy.get("#login_username"); + cy.contains('Invalid user name or password').should('not.exist'); + cy.contains('button', 'admin').click(); + cy.contains('Log Out').click(); + cy.get('#login_username'); }); -it("allows creating a project", () => { +it('allows creating a project', () => { cy.login(); - cy.visit("/harbor/projects"); - cy.fixture("projects").then((project) => { - cy.contains("button", "New Project").click(); - cy.get("#create_project_name").type(`${project.newProject.name}-${random}`); - cy.contains("button", "OK").should("not.be.disabled").click(); - cy.contains("Created project successfully"); + cy.visit('/harbor/projects'); + cy.fixture('projects').then((project) => { + cy.contains('button', 'New Project').click(); + cy.get('#create_project_name').type(`${project.newProject.name}-${random}`); + cy.contains('button', 'OK').should('not.be.disabled').click(); + cy.contains('Created project successfully'); }); }); -it("allows creating a registry", () => { +it('allows creating a registry', () => { cy.login(); - cy.visit("/harbor/registries"); - cy.fixture("registries").then((registry) => { - cy.contains("button", "New Endpoint").click(); - cy.get("#adapter").select(`${registry.newRegistry.provider}`); - cy.get("#destination_name").type(`${registry.newRegistry.name}-${random}`); - cy.contains("button", "OK").should("not.be.disabled").click(); - cy.contains(".datagrid-table", `${registry.newRegistry.name}-${random}`); + cy.visit('/harbor/registries'); + cy.fixture('registries').then((registry) => { + cy.contains('button', 'New Endpoint').click(); + cy.get('#adapter').select(`${registry.newRegistry.provider}`); + cy.get('#destination_name').type(`${registry.newRegistry.name}-${random}`); + cy.contains('button', 'OK').should('not.be.disabled').click(); + cy.contains('.datagrid-table', `${registry.newRegistry.name}-${random}`); }); }); -it("allows launching a vulnerability scan", () => { - const IMAGE_SCANNER = "Trivy"; +it('allows launching a vulnerability scan', () => { + const IMAGE_SCANNER = 'Trivy'; cy.login(); - cy.visit("/harbor/interrogation-services/scanners"); - cy.contains(".datagrid-table", IMAGE_SCANNER); - cy.contains("a", "Vulnerability").click(); - cy.contains("SCAN NOW").click(); - cy.contains("Trigger scan all successfully"); + cy.visit('/harbor/interrogation-services/scanners'); + cy.contains('.datagrid-table', IMAGE_SCANNER); + cy.contains('a', 'Vulnerability').click(); + cy.contains('SCAN NOW').click(); + cy.contains('Trigger scan all successfully'); }); -it("checks system configurations endpoint", () => { +it('checks system configurations endpoint', () => { cy.request({ - method: "GET", - url: "/api/v2.0/configurations", + method: 'GET', + url: '/api/v2.0/configurations', form: true, auth: { - username: Cypress.env("username"), - password: Cypress.env("password"), + username: Cypress.env('username'), + password: Cypress.env('password'), }, }).then((response) => { expect(response.status).to.eq(200); expect(response.body).to.include.all.keys( - "auth_mode", - "email_host", - "project_creation_restriction", - "scan_all_policy", - "self_registration" + 'auth_mode', + 'email_host', + 'project_creation_restriction', + 'scan_all_policy', + 'self_registration' ); }); }); diff --git a/.vib/harbor/cypress/cypress/integration/utils.js b/.vib/harbor/cypress/cypress/support/utils.js similarity index 100% rename from .vib/harbor/cypress/cypress/integration/utils.js rename to .vib/harbor/cypress/cypress/support/utils.js diff --git a/.vib/jenkins/cypress/cypress/integration/jenkins_spec.js b/.vib/jenkins/cypress/cypress/integration/jenkins_spec.js index 64b4a5b4f8..29463ad4fe 100644 --- a/.vib/jenkins/cypress/cypress/integration/jenkins_spec.js +++ b/.vib/jenkins/cypress/cypress/integration/jenkins_spec.js @@ -1,5 +1,5 @@ /// -import { random, checkErrors } from './utils'; +import { random, checkErrors } from '../support/utils'; it('allows to create system credentials', () => { cy.login(); diff --git a/.vib/jenkins/cypress/cypress/integration/utils.js b/.vib/jenkins/cypress/cypress/support/utils.js similarity index 100% rename from .vib/jenkins/cypress/cypress/integration/utils.js rename to .vib/jenkins/cypress/cypress/support/utils.js diff --git a/.vib/joomla/cypress/cypress/integration/joomla_spec.js b/.vib/joomla/cypress/cypress/integration/joomla_spec.js index ffc852648d..fb9df9f107 100644 --- a/.vib/joomla/cypress/cypress/integration/joomla_spec.js +++ b/.vib/joomla/cypress/cypress/integration/joomla_spec.js @@ -1,5 +1,5 @@ /// -import { random } from './utils'; +import { random } from '../support/utils'; it('allows user to log in and log out', () => { cy.login(); diff --git a/.vib/joomla/cypress/cypress/integration/utils.js b/.vib/joomla/cypress/cypress/support/utils.js similarity index 100% rename from .vib/joomla/cypress/cypress/integration/utils.js rename to .vib/joomla/cypress/cypress/support/utils.js diff --git a/.vib/keycloak/cypress/cypress/integration/keycloak_spec.js b/.vib/keycloak/cypress/cypress/integration/keycloak_spec.js index 5b51491c48..1f6b05c2ac 100644 --- a/.vib/keycloak/cypress/cypress/integration/keycloak_spec.js +++ b/.vib/keycloak/cypress/cypress/integration/keycloak_spec.js @@ -1,5 +1,5 @@ /// -import { random } from './utils'; +import { random } from '../support/utils'; it('allows login/logout', () => { cy.login(); diff --git a/.vib/keycloak/cypress/cypress/integration/utils.js b/.vib/keycloak/cypress/cypress/support/utils.js similarity index 100% rename from .vib/keycloak/cypress/cypress/integration/utils.js rename to .vib/keycloak/cypress/cypress/support/utils.js diff --git a/.vib/kibana/cypress/cypress/integration/kibana_spec.js b/.vib/kibana/cypress/cypress/integration/kibana_spec.js index 2d7f485ea1..21ad0379dd 100644 --- a/.vib/kibana/cypress/cypress/integration/kibana_spec.js +++ b/.vib/kibana/cypress/cypress/integration/kibana_spec.js @@ -1,6 +1,6 @@ /// -import { closeThePopups, skipTheWelcomeScreen, random } from './utils'; +import { closeThePopups, skipTheWelcomeScreen, random } from '../support/utils'; before(() => { skipTheWelcomeScreen(); diff --git a/.vib/kibana/cypress/cypress/integration/utils.js b/.vib/kibana/cypress/cypress/support/utils.js similarity index 100% rename from .vib/kibana/cypress/cypress/integration/utils.js rename to .vib/kibana/cypress/cypress/support/utils.js diff --git a/.vib/magento/cypress/cypress/integration/magento_spec.js b/.vib/magento/cypress/cypress/integration/magento_spec.js index c3e9401ecc..f207b8ba96 100644 --- a/.vib/magento/cypress/cypress/integration/magento_spec.js +++ b/.vib/magento/cypress/cypress/integration/magento_spec.js @@ -1,5 +1,5 @@ /// -import { random, allowDataUsage } from './utils'; +import { random, allowDataUsage } from '../support/utils'; before(() => { cy.login(); diff --git a/.vib/magento/cypress/cypress/integration/utils.js b/.vib/magento/cypress/cypress/support/utils.js similarity index 100% rename from .vib/magento/cypress/cypress/integration/utils.js rename to .vib/magento/cypress/cypress/support/utils.js diff --git a/.vib/matomo/cypress/cypress/integration/matomo_spec.js b/.vib/matomo/cypress/cypress/integration/matomo_spec.js index 4d1f8583e4..9c1d09b077 100644 --- a/.vib/matomo/cypress/cypress/integration/matomo_spec.js +++ b/.vib/matomo/cypress/cypress/integration/matomo_spec.js @@ -1,5 +1,5 @@ /// -import { random } from './utils'; +import { random } from '../support/utils'; it('allows to log in and out', () => { cy.login(); @@ -12,12 +12,8 @@ it('allows to create user', () => { cy.visit('/?module=UsersManager&showadduser=1'); cy.fixture('users').then((user) => { cy.get('#user_login').type(`${user.newUser.username}-${random}`); - cy.get('#user_password').type( - `${user.newUser.password}-${random}` - ); - cy.get('#user_password').type( - `${user.newUser.password}-${random}` - ); + cy.get('#user_password').type(`${user.newUser.password}-${random}`); + cy.get('#user_password').type(`${user.newUser.password}-${random}`); cy.get('#user_email').type(`${random}_${user.newUser.email}`); cy.get('input[value*="Create user"]').click(); cy.contains('changes have been saved'); @@ -34,8 +30,12 @@ it('allows to create a new website', () => { cy.get('button[title*="A website"]').click(); cy.fixture('websites').then((site) => { // The name input has no attribute "name" or "id" - cy.get('input[placeholder="Name"]').type(`${site.newSite.name} ${random}`, { force: true }); - cy.get('textarea[name="urls"]').type(`${site.newSite.url}`, { force: true }); + cy.get('input[placeholder="Name"]').type(`${site.newSite.name} ${random}`, { + force: true, + }); + cy.get('textarea[name="urls"]').type(`${site.newSite.url}`, { + force: true, + }); }); cy.get('input[type="submit"]').click(); cy.contains('Website created'); @@ -51,15 +51,18 @@ it('allows to use the API', () => { cy.get('#description').type(random); cy.get('input[type="submit"]').click(); cy.contains('Token successfully generated'); - cy.get('code').invoke('text').then((apiToken) => { - cy.request( - '/index.php?module=API&method=API.getMatomoVersion' - + `&format=JSON&token_auth=${apiToken}`).then((response) => { + cy.get('code') + .invoke('text') + .then((apiToken) => { + cy.request( + '/index.php?module=API&method=API.getMatomoVersion' + + `&format=JSON&token_auth=${apiToken}` + ).then((response) => { const bodyString = JSON.stringify(response.body); expect(response.status).to.eq(200); expect(bodyString).to.contain('"value":'); + }); }); - }); }); it('allows to change users settings', () => { diff --git a/.vib/matomo/cypress/cypress/integration/utils.js b/.vib/matomo/cypress/cypress/support/utils.js similarity index 100% rename from .vib/matomo/cypress/cypress/integration/utils.js rename to .vib/matomo/cypress/cypress/support/utils.js diff --git a/.vib/mediawiki/cypress/cypress/integration/mediawiki_spec.js b/.vib/mediawiki/cypress/cypress/integration/mediawiki_spec.js index fc3fe14c55..24155cfff9 100644 --- a/.vib/mediawiki/cypress/cypress/integration/mediawiki_spec.js +++ b/.vib/mediawiki/cypress/cypress/integration/mediawiki_spec.js @@ -1,9 +1,9 @@ /// -import { random, getPageUrlFromTitle, confirmLogOut } from './utils'; +import { random, getPageUrlFromTitle, confirmLogOut } from '../support/utils'; it('allows to log in and out', () => { cy.login(); - cy.contains('li','Preferences') + cy.contains('li', 'Preferences'); cy.contains('Log out').click(); confirmLogOut(); cy.contains('You are now logged out'); @@ -45,12 +45,9 @@ it('allows to create a new page', () => { it('allows to upload a file', () => { cy.login(); cy.visit('/wiki/Special:Upload'); - cy.get('#wpUploadFile').selectFile( - 'cypress/fixtures/images/post_image.png', - { - force: true, - } - ); + cy.get('#wpUploadFile').selectFile('cypress/fixtures/images/post_image.png', { + force: true, + }); // We'll use a random fileName to bypass duplication-related errors cy.get('input[name="wpDestFile"]').type(`${random}.png`); // If Mediawiki detects that an identical file was already uploaded diff --git a/.vib/mediawiki/cypress/cypress/integration/utils.js b/.vib/mediawiki/cypress/cypress/support/utils.js similarity index 100% rename from .vib/mediawiki/cypress/cypress/integration/utils.js rename to .vib/mediawiki/cypress/cypress/support/utils.js diff --git a/.vib/minio/cypress/cypress/integration/minio_spec.js b/.vib/minio/cypress/cypress/integration/minio_spec.js index 7be7bd5e45..d2741ccfc7 100644 --- a/.vib/minio/cypress/cypress/integration/minio_spec.js +++ b/.vib/minio/cypress/cypress/integration/minio_spec.js @@ -1,5 +1,5 @@ /// -import { random } from './utils'; +import { random } from '../support/utils'; it('allows user to log in and log out', () => { cy.login(); diff --git a/.vib/minio/cypress/cypress/support/index.js b/.vib/minio/cypress/cypress/support/index.js index d68db96df2..37a498fb5b 100644 --- a/.vib/minio/cypress/cypress/support/index.js +++ b/.vib/minio/cypress/cypress/support/index.js @@ -14,7 +14,7 @@ // *********************************************************** // Import commands.js using ES2015 syntax: -import './commands' +import './commands'; // Alternatively you can use CommonJS syntax: // require('./commands') diff --git a/.vib/minio/cypress/cypress/integration/utils.js b/.vib/minio/cypress/cypress/support/utils.js similarity index 100% rename from .vib/minio/cypress/cypress/integration/utils.js rename to .vib/minio/cypress/cypress/support/utils.js diff --git a/.vib/opencart/cypress/cypress/integration/opencart_spec.js b/.vib/opencart/cypress/cypress/integration/opencart_spec.js index 8e75db68d4..974b4fba02 100644 --- a/.vib/opencart/cypress/cypress/integration/opencart_spec.js +++ b/.vib/opencart/cypress/cypress/integration/opencart_spec.js @@ -1,5 +1,5 @@ /// -import { random } from './utils'; +import { random } from '../support/utils'; it('allows a user to register', () => { cy.visit('/index.php?route=account/login'); diff --git a/.vib/opencart/cypress/cypress/integration/utils.js b/.vib/opencart/cypress/cypress/support/utils.js similarity index 100% rename from .vib/opencart/cypress/cypress/integration/utils.js rename to .vib/opencart/cypress/cypress/support/utils.js diff --git a/.vib/owncloud/cypress/cypress/integration/owncloud_spec.js b/.vib/owncloud/cypress/cypress/integration/owncloud_spec.js index 6adac67801..0d3e8269d2 100644 --- a/.vib/owncloud/cypress/cypress/integration/owncloud_spec.js +++ b/.vib/owncloud/cypress/cypress/integration/owncloud_spec.js @@ -1,5 +1,5 @@ /// -import { random } from './utils'; +import { random } from '../support/utils'; it('allows creating a folder and uploading a file ', () => { cy.login(); diff --git a/.vib/owncloud/cypress/cypress/integration/utils.js b/.vib/owncloud/cypress/cypress/support/utils.js similarity index 100% rename from .vib/owncloud/cypress/cypress/integration/utils.js rename to .vib/owncloud/cypress/cypress/support/utils.js diff --git a/.vib/phpmyadmin/cypress/cypress/integration/phpmyadmin_spec.js b/.vib/phpmyadmin/cypress/cypress/integration/phpmyadmin_spec.js index 8d5e24ca78..9f4922e391 100644 --- a/.vib/phpmyadmin/cypress/cypress/integration/phpmyadmin_spec.js +++ b/.vib/phpmyadmin/cypress/cypress/integration/phpmyadmin_spec.js @@ -1,5 +1,5 @@ /// -import { random } from './utils'; +import { random } from '../support/utils'; it('allows the user to log in and log out', () => { cy.login(); @@ -12,7 +12,9 @@ it('allows creating a database and a table', () => { cy.login(); cy.visit('index.php?route=/server/databases'); cy.fixture('testdata').then((td) => { - cy.get('#text_create_db').type(`${td.databaseName}.${random}`, { force: true }); + cy.get('#text_create_db').type(`${td.databaseName}.${random}`, { + force: true, + }); cy.get('#buttonGo').click({ force: true }); cy.get('.lock-page [type="text"]').type(`${td.tableName}.${random}`); cy.get('.lock-page [type="number"]').clear().type(td.columnNumber); diff --git a/.vib/phpmyadmin/cypress/cypress/integration/utils.js b/.vib/phpmyadmin/cypress/cypress/support/utils.js similarity index 100% rename from .vib/phpmyadmin/cypress/cypress/integration/utils.js rename to .vib/phpmyadmin/cypress/cypress/support/utils.js diff --git a/.vib/prestashop/cypress/cypress/integration/prestashop_spec.js b/.vib/prestashop/cypress/cypress/integration/prestashop_spec.js index 85b6e6f109..7e267de402 100644 --- a/.vib/prestashop/cypress/cypress/integration/prestashop_spec.js +++ b/.vib/prestashop/cypress/cypress/integration/prestashop_spec.js @@ -1,5 +1,5 @@ /// -import { random } from './utils'; +import { random } from '../support/utils'; // Note: Interaction with the UI is preferred over cy.visit() as // PrestaShop requires to provide a token within the URL or else diff --git a/.vib/prestashop/cypress/cypress/integration/utils.js b/.vib/prestashop/cypress/cypress/support/utils.js similarity index 100% rename from .vib/prestashop/cypress/cypress/integration/utils.js rename to .vib/prestashop/cypress/cypress/support/utils.js diff --git a/.vib/rabbitmq/cypress/cypress/integration/rabbitmq_spec.js b/.vib/rabbitmq/cypress/cypress/integration/rabbitmq_spec.js index 92fee3d0f0..136a361f55 100644 --- a/.vib/rabbitmq/cypress/cypress/integration/rabbitmq_spec.js +++ b/.vib/rabbitmq/cypress/cypress/integration/rabbitmq_spec.js @@ -1,5 +1,5 @@ /// -import { random } from './utils'; +import { random } from '../support/utils'; it('allows login/logout', () => { cy.login(); diff --git a/.vib/rabbitmq/cypress/cypress/integration/utils.js b/.vib/rabbitmq/cypress/cypress/support/utils.js similarity index 100% rename from .vib/rabbitmq/cypress/cypress/integration/utils.js rename to .vib/rabbitmq/cypress/cypress/support/utils.js diff --git a/.vib/redmine/cypress/cypress/integration/redmine_spec.js b/.vib/redmine/cypress/cypress/integration/redmine_spec.js index 19571d1aae..8e15df2394 100644 --- a/.vib/redmine/cypress/cypress/integration/redmine_spec.js +++ b/.vib/redmine/cypress/cypress/integration/redmine_spec.js @@ -1,5 +1,5 @@ /// -import { random } from './utils'; +import { random } from '../support/utils'; it('allows admin to login/logout', () => { cy.login(); diff --git a/.vib/redmine/cypress/cypress/integration/utils.js b/.vib/redmine/cypress/cypress/support/utils.js similarity index 100% rename from .vib/redmine/cypress/cypress/integration/utils.js rename to .vib/redmine/cypress/cypress/support/utils.js diff --git a/.vib/solr/cypress/cypress/integration/solr_spec.js b/.vib/solr/cypress/cypress/integration/solr_spec.js index 2add116633..6df6e28a40 100644 --- a/.vib/solr/cypress/cypress/integration/solr_spec.js +++ b/.vib/solr/cypress/cypress/integration/solr_spec.js @@ -1,37 +1,37 @@ /// -import { random, getBasicAuthHeader } from "../support/utils"; +import { random, getBasicAuthHeader } from '../support/utils'; -it("allows accessing the Dashboard", () => { +it('allows accessing the Dashboard', () => { cy.login(); - cy.visit("/solr/#/"); - cy.contains("Unauthorized").should("not.exist"); + cy.visit('/solr/#/'); + cy.contains('Unauthorized').should('not.exist'); - cy.contains("solr-spec"); - cy.contains("JVM"); - cy.contains("solr.install.dir=/opt/bitnami/solr"); + cy.contains('solr-spec'); + cy.contains('JVM'); + cy.contains('solr.install.dir=/opt/bitnami/solr'); }); -it("checks all nodes are up", () => { +it('checks all nodes are up', () => { const NUMBER_OF_NODES = 3; cy.login(); - cy.visit("/solr/#/~cloud"); + cy.visit('/solr/#/~cloud'); - cy.get("table#nodes-table").within(() => { - cy.get('div[class*="host-name"]').should("have.length", NUMBER_OF_NODES); + cy.get('table#nodes-table').within(() => { + cy.get('div[class*="host-name"]').should('have.length', NUMBER_OF_NODES); }); }); -it("allows registering a user", () => { +it('allows registering a user', () => { cy.login(); - cy.visit("/solr/#/~security"); + cy.visit('/solr/#/~security'); - cy.fixture("users").then((users) => { - cy.contains("button", "Add User").click(); - cy.get("input#add_user").type(`${users.newUser.username}.${random}`); - cy.get("input#add_user_password").type(users.newUser.password); - cy.get("input#add_user_password2").type(users.newUser.password); - cy.contains("button", "Add User").click(); - cy.contains("td", `${users.newUser.username}.${random}`); + cy.fixture('users').then((users) => { + cy.contains('button', 'Add User').click(); + cy.get('input#add_user').type(`${users.newUser.username}.${random}`); + cy.get('input#add_user_password').type(users.newUser.password); + cy.get('input#add_user_password2').type(users.newUser.password); + cy.contains('button', 'Add User').click(); + cy.contains('td', `${users.newUser.username}.${random}`); }); }); @@ -40,42 +40,42 @@ it("allows registering a user", () => { * Cypress seems to struggle setting the Content-Type header to application/json * and the server refuses to process a octet-stream object. Use the API instead. */ -it("allows uploading and indexing a file", () => { - cy.fixture("books").then(($books) => { +it('allows uploading and indexing a file', () => { + cy.fixture('books').then(($books) => { const formData = new FormData(); var content = new Blob([JSON.stringify($books)], { - type: "application/json", + type: 'application/json', }); - formData.set("user-file", content, "data.js"); + formData.set('user-file', content, 'data.js'); cy.request({ - url: "/solr/my-collection/update", + url: '/solr/my-collection/update', qs: { commitWithin: 1000, overwrite: true, commit: true, - wt: "json", + wt: 'json', }, - method: "POST", + method: 'POST', headers: { Authorization: getBasicAuthHeader(), }, body: formData, }) - .its("status") - .should("be.equal", 200); + .its('status') + .should('be.equal', 200); }); - cy.fixture("books").then(($books) => { + cy.fixture('books').then(($books) => { // Get an arbitrary book from the collection var book = $books[Math.floor(Math.random() * $books.length)]; cy.request({ - url: "/solr/my-collection/query", + url: '/solr/my-collection/query', qs: { q: `title:${book.title}`, - "q.op": "OR", + 'q.op': 'OR', indent: true, }, - method: "GET", + method: 'GET', headers: { Authorization: getBasicAuthHeader(), }, @@ -88,10 +88,10 @@ it("allows uploading and indexing a file", () => { }); }); -it("allows retrieving sample schema", () => { +it('allows retrieving sample schema', () => { cy.request({ - url: "/solr/my-collection/schema", - method: "GET", + url: '/solr/my-collection/schema', + method: 'GET', headers: { Authorization: getBasicAuthHeader(), }, @@ -99,6 +99,6 @@ it("allows retrieving sample schema", () => { var bodyString = JSON.stringify(response.body); expect(response.status).to.eq(200); expect(bodyString).to.contain('"name":"text_es"'); - expect(bodyString).to.contain("queryAnalyzer"); + expect(bodyString).to.contain('queryAnalyzer'); }); }); diff --git a/.vib/spring-cloud-dataflow/cypress/cypress/integration/spring_cloud_dataflow_spec.js b/.vib/spring-cloud-dataflow/cypress/cypress/integration/spring_cloud_dataflow_spec.js index 8a5b971d0e..2c908843e8 100644 --- a/.vib/spring-cloud-dataflow/cypress/cypress/integration/spring_cloud_dataflow_spec.js +++ b/.vib/spring-cloud-dataflow/cypress/cypress/integration/spring_cloud_dataflow_spec.js @@ -1,6 +1,9 @@ /// -import { random } from './utils.js'; -import { importAnApplication, createATask } from './prepare_app_state.js'; +import { random } from '../support/utils.js'; +import { + importAnApplication, + createATask, +} from '../support/prepare_app_state.js'; it('allows getting Spring Cloud Dataflow info', () => { cy.visit('/dashboard'); diff --git a/.vib/spring-cloud-dataflow/cypress/cypress/integration/prepare_app_state.js b/.vib/spring-cloud-dataflow/cypress/cypress/support/prepare_app_state.js similarity index 100% rename from .vib/spring-cloud-dataflow/cypress/cypress/integration/prepare_app_state.js rename to .vib/spring-cloud-dataflow/cypress/cypress/support/prepare_app_state.js diff --git a/.vib/spring-cloud-dataflow/cypress/cypress/integration/utils.js b/.vib/spring-cloud-dataflow/cypress/cypress/support/utils.js similarity index 100% rename from .vib/spring-cloud-dataflow/cypress/cypress/integration/utils.js rename to .vib/spring-cloud-dataflow/cypress/cypress/support/utils.js diff --git a/.vib/suitecrm/cypress/cypress/integration/suitecrm_spec.js b/.vib/suitecrm/cypress/cypress/integration/suitecrm_spec.js index 1fae198afd..da008eaa3d 100644 --- a/.vib/suitecrm/cypress/cypress/integration/suitecrm_spec.js +++ b/.vib/suitecrm/cypress/cypress/integration/suitecrm_spec.js @@ -1,5 +1,5 @@ /// -import { random } from './utils'; +import { random } from '../support/utils'; it('allows to log in/log out', () => { cy.login(); diff --git a/.vib/suitecrm/cypress/cypress/integration/utils.js b/.vib/suitecrm/cypress/cypress/support/utils.js similarity index 100% rename from .vib/suitecrm/cypress/cypress/integration/utils.js rename to .vib/suitecrm/cypress/cypress/support/utils.js diff --git a/.vib/wordpress/cypress/cypress/integration/wordpress_spec.js b/.vib/wordpress/cypress/cypress/integration/wordpress_spec.js index a3f6893cfd..cf1641182c 100644 --- a/.vib/wordpress/cypress/cypress/integration/wordpress_spec.js +++ b/.vib/wordpress/cypress/cypress/integration/wordpress_spec.js @@ -1,6 +1,6 @@ /// -import { random } from './utils'; +import { random } from '../support/utils'; it('allows login/logout', () => { cy.login(); diff --git a/.vib/wordpress/cypress/cypress/integration/utils.js b/.vib/wordpress/cypress/cypress/support/utils.js similarity index 100% rename from .vib/wordpress/cypress/cypress/integration/utils.js rename to .vib/wordpress/cypress/cypress/support/utils.js