Commit efbcf945 authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Añade tests funcionales programados por browser

Sigue la misma lógica de los demás conjuntos de jobs de testeo,
definiendo una base y extendiendo para lanzar jobs con un browser
fijado. En este caso, deja de fijar chrome en el job base e incluye 2
nuevos jobs en parelelo, uno para chrome y otro para firefox.

Refactoriza scripts para mejorar legibilidad.
parent 282c8349
Loading
Loading
Loading
Loading
+52 −17
Original line number Diff line number Diff line
@@ -40,8 +40,12 @@ run-local-unit-tests:
    <<: *run-local-tests-variables
  script:
    - >
      grunt test-unit-local --headless --browser=${TEST_BROWSER} --seleniumVersion=${LOCAL_SELENIUM_VERSION}
      --chromeVersion=${LOCAL_CHROME_VERSION} | tee test.out
      grunt test-unit-local
        --headless
        --browser=${TEST_BROWSER}
        --seleniumVersion=${LOCAL_SELENIUM_VERSION}
        --chromeVersion=${LOCAL_CHROME_VERSION}
      | tee test.out

.run-remote-unit-tests:
  extends: .run-unit-tests
@@ -49,9 +53,15 @@ run-local-unit-tests:
    <<: *run-remote-tests-variables
  script:
    - >
      grunt test-unit-remote --headless --browser=${TEST_BROWSER} --ownServerHost="${TEST_OWN_SERVER_HOST}"
      --remoteHost=${TEST_REMOTE_HOST} --seleniumVersion=${REMOTE_SELENIUM_VERSION}
      --chromeVersion=${REMOTE_CHROME_VERSION} --firefoxVersion=${REMOTE_FIREFOX_VERSION} | tee test.out
      grunt test-unit-remote
        --headless
        --browser=${TEST_BROWSER}
        --ownServerHost="${TEST_OWN_SERVER_HOST}"
        --remoteHost=${TEST_REMOTE_HOST}
        --seleniumVersion=${REMOTE_SELENIUM_VERSION}
        --chromeVersion=${REMOTE_CHROME_VERSION}
        --firefoxVersion=${REMOTE_FIREFOX_VERSION}
      | tee test.out

run-remote-unit-tests-chrome:
  extends: .run-remote-unit-tests
@@ -79,8 +89,12 @@ run-local-modules-functional-tests:
    - grunt buildStyles
    - npm start &
    - >
      grunt test-functional-local --functionalSuites=tests/functional/modules/**/!\(*Script\).js --headless
      --browser=${TEST_BROWSER} --seleniumVersion=${LOCAL_SELENIUM_VERSION} --chromeVersion=${LOCAL_CHROME_VERSION}
      grunt test-functional-local
        --functionalSuites=tests/functional/modules/**/!\(*Script\).js
        --headless
        --browser=${TEST_BROWSER}
        --seleniumVersion=${LOCAL_SELENIUM_VERSION}
        --chromeVersion=${LOCAL_CHROME_VERSION}
  artifacts: &run-functional-tests-artifacts

.run-remote-modules-functional-tests:
@@ -91,9 +105,14 @@ run-local-modules-functional-tests:
    - grunt buildStyles
    - npm start &
    - >
      grunt test-functional-remote --functionalSuites=tests/functional/modules/**/!\(*Script\).js --headless
      --browser=${TEST_BROWSER} --ownServerHost="${TEST_OWN_SERVER_HOST}" --remoteHost=${TEST_REMOTE_HOST}
      --seleniumVersion=${REMOTE_SELENIUM_VERSION} --chromeVersion=${REMOTE_CHROME_VERSION}
      grunt test-functional-remote
        --functionalSuites=tests/functional/modules/**/!\(*Script\).js
        --headless
        --browser=${TEST_BROWSER}
        --ownServerHost="${TEST_OWN_SERVER_HOST}"
        --remoteHost=${TEST_REMOTE_HOST}
        --seleniumVersion=${REMOTE_SELENIUM_VERSION}
        --chromeVersion=${REMOTE_CHROME_VERSION}
        --firefoxVersion=${REMOTE_FIREFOX_VERSION}
  artifacts: &run-functional-tests-artifacts

@@ -107,21 +126,37 @@ run-remote-modules-functional-tests-firefox:
  variables:
    TEST_BROWSER: firefox

run-scheduled-remote-functional-tests:
.run-scheduled-remote-functional-tests:
  extends: .run-tests
  stage: test-deploy
  variables:
    <<: *run-remote-tests-variables
    SERVER_URL: https://${DEV_PUBLIC_HOSTNAME}
    TEST_BROWSER: chrome
    TEST_ROLE: administrator
  script:
    - >
      grunt test-functional-remote --serverUrl="${SERVER_URL}" --user="${REDMIC_TEST_USER}" --pass="${REDMIC_TEST_PASS}"
      --role=${TEST_ROLE} --suitesGroups="${SUITES_GROUPS}" --browser=${TEST_BROWSER} --remoteHost=${TEST_REMOTE_HOST}
      --seleniumVersion=${REMOTE_SELENIUM_VERSION} --chromeVersion=${REMOTE_CHROME_VERSION}
      grunt test-functional-remote
        --serverUrl="${SERVER_URL}"
        --user="${REDMIC_TEST_USER}"
        --pass="${REDMIC_TEST_PASS}"
        --role=${TEST_ROLE}
        --suitesGroups="${SUITES_GROUPS}"
        --browser=${TEST_BROWSER}
        --remoteHost=${TEST_REMOTE_HOST}
        --seleniumVersion=${REMOTE_SELENIUM_VERSION}
        --chromeVersion=${REMOTE_CHROME_VERSION}
        --firefoxVersion=${REMOTE_FIREFOX_VERSION}
  dependencies: []
  artifacts: &run-functional-tests-artifacts
  rules:
    - if: $CI_PIPELINE_SOURCE == "schedule"

run-scheduled-remote-functional-tests-chrome:
  extends: .run-scheduled-remote-functional-tests
  variables:
    TEST_BROWSER: chrome

run-scheduled-remote-functional-tests-firefox:
  extends: .run-scheduled-remote-functional-tests
  variables:
    TEST_BROWSER: firefox