Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cypress/update to cypress10 #267

Merged
merged 26 commits into from
Nov 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
6600d66
Bumping Cypress to v10.11.0
mmartin24 Oct 31, 2022
89dc7f7
updating config file
mmartin24 Oct 31, 2022
2c19ddd
updating cypress.json to cypress.config.ts for Dockerfile and ca
mmartin24 Oct 31, 2022
7ed5612
updating tests routes
mmartin24 Nov 1, 2022
d4a75f8
updating docker images to 10.11.0 for std ui
mmartin24 Nov 2, 2022
a4218bd
extending time for binary download to occur for Cypress 10
mmartin24 Nov 2, 2022
5aeb3ab
Improving sourcetype locator
mmartin24 Nov 2, 2022
3d55a63
Improving waits for dropdowns in CI
mmartin24 Nov 3, 2022
a7355c2
adding checks to runners
mmartin24 Nov 3, 2022
909cb56
skipping some tests to check runner
mmartin24 Nov 3, 2022
f155e1c
setting check runners to indiviual runners for std ui
mmartin24 Nov 3, 2022
23ab2bb
removing checks for runners
mmartin24 Nov 3, 2022
a69b0f2
Adding more explicit time on src dropdown and binaries to attemtp avo…
mmartin24 Nov 3, 2022
89f64b6
Adding logs and screenshots for debugging ci
mmartin24 Nov 3, 2022
0ff509e
removing tests kept in memory flag
mmartin24 Nov 4, 2022
a90bfe6
changing cypress docker version for ff
mmartin24 Nov 4, 2022
acc635a
changing docker version for ff to 10.3.1
mmartin24 Nov 4, 2022
b830a60
Changing back cypress with ff to 10.9.0
mmartin24 Nov 4, 2022
81fc2ed
Updating browser images for rd tests.
mmartin24 Nov 4, 2022
9e51e00
replacing debug docker
mmartin24 Nov 4, 2022
1f915a9
removing debug
mmartin24 Nov 4, 2022
6db7104
bringing back tests / adding bit more extra rtime after clicking on b…
mmartin24 Nov 6, 2022
6ee6c61
rmoving debug wait time and task.
mmartin24 Nov 6, 2022
6532401
testing bump ff Std UI to 10.11
mmartin24 Nov 7, 2022
8348e31
returning ff to v 10.9.0 / 99
mmartin24 Nov 7, 2022
32ecf7b
updating Cypress with FF in STD UI to v10.9.0 in all tests
mmartin24 Nov 7, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/workflows/master_rancher_ui_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ jobs:
browser: ${{ inputs.browser }}
headless: true
spec: |
cypress/integration/unit_tests/first_connexion.spec.ts
cypress/integration/unit_tests/${{ inputs.cypress_install_test }}
config-file: cypress-with-epinio-cert.json
cypress/e2e/unit_tests/first_connexion.spec.ts
cypress/e2e/unit_tests/${{ inputs.cypress_install_test }}
config-file: cypress.config.ts

- name: Copying screenshots and videos to Mochawesome report
if: always()
Expand Down Expand Up @@ -217,8 +217,8 @@ jobs:
browser: ${{ inputs.browser }}
headless: true
spec: |
cypress/integration/unit_tests/${{ inputs.cypress_test }}
config-file: cypress-with-epinio-cert.json
cypress/e2e/unit_tests/${{ inputs.cypress_test }}
config-file: cypress.config.ts

- name: Copying screenshots and videos to Mochawesome report
if: always()
Expand Down Expand Up @@ -277,8 +277,8 @@ jobs:
browser: ${{ inputs.browser }}
headless: true
spec: |
cypress/integration/unit_tests/uninstall.spec.ts
config-file: cypress-with-epinio-cert.json
cypress/e2e/unit_tests/uninstall.spec.ts
config-file: cypress.config.ts

- name: Copying screenshots and videos to Mochawesome report
if: always()
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/master_std_ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ jobs:
- name: Start Cypress tests
env:
BROWSER: ${{ inputs.browser }}
CYPRESS_CFG: cypress-with-epinio-cert.json
CYPRESS_CFG: cypress.config.ts
CYPRESS_DOCKER: ${{ inputs.cypress_docker }}
DOCKER_OPTIONS: ${{ inputs.docker_options }}
EXT_REG_USER: ${{ secrets.EPINIO_DOCKER_USER }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scenario_1_chrome_rancher_ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
uses: ./.github/workflows/master_rancher_ui_workflow.yml
with:
browser: chrome
cypress_image: cypress/browsers:node16.13.2-chrome97-ff96
cypress_image: cypress/browsers:node16.14.2-slim-chrome100-ff99-edge
cypress_install_test: installation.spec.ts
# cypress_test: with_default_options.spec.ts
cypress_test: menu.spec.ts
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scenario_2_firefox_rancher_ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
uses: ./.github/workflows/master_rancher_ui_workflow.yml
with:
browser: firefox
cypress_image: cypress/browsers:node16.13.2-chrome97-ff96
cypress_image: cypress/browsers:node16.14.2-slim-chrome100-ff99-edge
cypress_install_test: installation.spec.ts
# cypress_test: with_s3_and_external_registry.spec.ts
cypress_test: menu.spec.ts
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/std_ui_latest_chrome.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,30 @@ jobs:
uses: ./.github/workflows/master_std_ui.yml
with:
browser: chrome
cypress_docker: cypress/included:9.7.0
cypress_spec: cypress/integration/unit_tests/menu.spec.ts
cypress_docker: cypress/included:10.11.0
cypress_spec: cypress/e2e/unit_tests/menu.spec.ts
secrets: inherit

configurations-tests:
uses: ./.github/workflows/master_std_ui.yml
with:
browser: chrome
cypress_docker: cypress/included:9.7.0
cypress_spec: cypress/integration/unit_tests/configurations.spec.ts
cypress_docker: cypress/included:10.11.0
cypress_spec: cypress/e2e/unit_tests/configurations.spec.ts
secrets: inherit

applications-tests:
uses: ./.github/workflows/master_std_ui.yml
with:
browser: chrome
cypress_docker: cypress/included:9.7.0
cypress_spec: cypress/integration/unit_tests/applications.spec.ts
cypress_docker: cypress/included:10.11.0
cypress_spec: cypress/e2e/unit_tests/applications.spec.ts
secrets: inherit

namespaces-tests:
uses: ./.github/workflows/master_std_ui.yml
with:
browser: chrome
cypress_docker: cypress/included:9.7.0
cypress_spec: cypress/integration/unit_tests/namespaces.spec.ts
cypress_docker: cypress/included:10.11.0
cypress_spec: cypress/e2e/unit_tests/namespaces.spec.ts
secrets: inherit
16 changes: 8 additions & 8 deletions .github/workflows/std_ui_latest_firefox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ jobs:
#uses: ./.github/workflows/master_std_ui.yml
#with:
#browser: firefox
#cypress_docker: cypress/included:9.7.0
#cypress_spec: cypress/integration/unit_tests/menu.spec.ts
#cypress_docker: cypress/included:10.9.0
#cypress_spec: cypress/e2e/unit_tests/menu.spec.ts
#docker_options: '--user 1000'
#ext_reg: '1'
#s3: '1'
Expand All @@ -30,8 +30,8 @@ jobs:
#uses: ./.github/workflows/master_std_ui.yml
#with:
#browser: firefox
#cypress_docker: cypress/included:9.7.0
#cypress_spec: cypress/integration/unit_tests/configurations.spec.ts
#cypress_docker: cypress/included:10.9.0
#cypress_spec: cypress/e2e/unit_tests/configurations.spec.ts
#docker_options: '--user 1000'
#ext_reg: '1'
#s3: '1'
Expand All @@ -41,8 +41,8 @@ jobs:
#uses: ./.github/workflows/master_std_ui.yml
#with:
#browser: firefox
#cypress_docker: cypress/included:9.7.0
#cypress_spec: cypress/integration/unit_tests/applications.spec.ts
#cypress_docker: cypress/included:10.9.0
#cypress_spec: cypress/e2e/unit_tests/applications.spec.ts
#docker_options: '--user 1000'
#ext_reg: '1'
#s3: '1'
Expand All @@ -52,8 +52,8 @@ jobs:
uses: ./.github/workflows/master_std_ui.yml
with:
browser: firefox
cypress_docker: cypress/included:9.7.0
cypress_spec: cypress/integration/unit_tests/namespaces.spec.ts
cypress_docker: cypress/included:10.9.0
cypress_spec: cypress/e2e/unit_tests/namespaces.spec.ts
docker_options: '--user 1000'
ext_reg: '1'
s3: '1'
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM cypress/base:16.13.0

COPY cypress.json .
COPY cypress.config.ts .
COPY tsconfig.json .
COPY package.json .
COPY ./cypress/ cypress
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ build-image: ## Build the e2e_image with latest tests version

cypress-gui: ## Start Cypress in GUI mode, need graphical environment
npm install
./node_modules/cypress/bin/cypress open -C cypress-with-epinio-cert.json
./node_modules/cypress/bin/cypress open -C cypress.config.ts

check-dependencies:
command -v docker && echo "docker - ok"
Expand Down
32 changes: 0 additions & 32 deletions cypress-with-epinio-cert.json

This file was deleted.

40 changes: 40 additions & 0 deletions cypress.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { defineConfig } from 'cypress'

// export default defineConfig({
export default defineConfig({
defaultCommandTimeout: 10000,
// numTestsKeptInMemory:25,
reporter: 'mochawesome',
reporterOptions: {
reportFilename: '[name]-report_[status]_[datetime]',
timestamp: 'shortDate',
},
clientCertificates: [
{
url: 'https://*',
ca: [],
certs: [
{
cert: 'cypress/fixtures/epinio-private-cert-pem.file',
key: 'cypress/fixtures/epinio-private-key-pem.file',
},
],
},
],
e2e: {
// We've imported your old cypress plugins here.
// You may want to clean this up later by importing these.
setupNodeEvents(on, config) {
on('task', {
log(message) {
console.log(message)
return null
},
})
return require('./cypress/plugins/index.ts')(on, config)
},
experimentalSessionAndOrigin: true,
specPattern:
'cypress/e2e/unit_tests/*.spec.ts',
},
})
27 changes: 0 additions & 27 deletions cypress.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,13 @@ describe('Menu testing', () => {
// Source: https://github.com/cypress-io/cypress/issues/14857#issuecomment-785717474
cy.window().document().then(function (doc) {
doc.addEventListener('click', () => {
setTimeout(function () { doc.location.reload(); }, 5000);
setTimeout(function () { doc.location.reload(); }, 10000);
});
// Now we can download
// cy.wait(2000);
cy.get("tr.link > td > a").eq(i).click({ force: true });
// Adding a bit of wait prior executing command to ensure file is downloaded
cy.wait(1500);
cy.wait(7000);
});

// Verify files are downloaded in cypress/download
Expand Down
File renamed without changes.
12 changes: 9 additions & 3 deletions cypress/support/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,12 @@ Cypress.Commands.add('createApp', ({appName, archiveName, sourceType, customPake

// Select the Source Type if needed
if (sourceType) {
cy.get('.labeled-select').click();
cy.contains(sourceType, {timeout: 120000}).click();
// Adding explicit wait here to attempt avoid failure in CI
cy.wait(5000)
cy.get('.labeled-select.hoverable').contains('Source Type', {timeout: 10000}).should('be.visible').click( {force : true} );
cy.wait(1000)
cy.screenshot('SrcType Dropown after opening')
cy.contains(sourceType, {timeout: 10000}).should('be.visible').click({force: true});
switch (sourceType) {
case 'Container Image':
cy.typeValue({label: 'Image', value: archiveName});
Expand All @@ -193,7 +197,9 @@ Cypress.Commands.add('createApp', ({appName, archiveName, sourceType, customPake
cy.typeValue({label: 'Branch', value: 'main'});
break;
case 'Archive':
cy.get(' button[data-testid="epinio_app-source_archive_file"] input[type="file"]').attachFile({filePath: archiveName, encoding: 'base64', mimeType: 'application/octet-stream'});
cy.screenshot('SrcType Dropown opened BEFORE selecting ARCHIVE')
cy.get(' button[data-testid="epinio_app-source_archive_file"] input[type="file"]').attachFile({filePath: archiveName, encoding: 'base64', mimeType: 'application/octet-stream'});
cy.screenshot('SrcType Dropown opened AFTER selecting ARCHIVE')
break;
case 'GitHub':
cy.get('.labeled-input.edit.has-tooltip',{timeout:5000}).contains('label', 'Username / Organization').should('be.visible')
Expand Down
Loading