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

initial visual testing coverage for git repo #13444

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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: 14 additions & 0 deletions cypress/e2e/tests/pages/fleet/gitrepo.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { generateFakeClusterDataAndIntercepts } from '@/cypress/e2e/blueprints/n
import PreferencesPagePo from '@/cypress/e2e/po/pages/preferences.po';
import { EXTRA_LONG_TIMEOUT_OPT } from '@/cypress/support/utils/timeouts';
import { HeaderPo } from '@/cypress/e2e/po/components/header.po';
import 'cypress-real-events/support';

const fakeProvClusterId = 'some-fake-cluster-id';
const fakeMgmtClusterId = 'some-fake-mgmt-id';
Expand Down Expand Up @@ -63,6 +64,19 @@ describe('Git Repo', { testIsolation: 'off', tags: ['@fleet', '@adminUser'] }, (
gitRepoCreatePage.helmAuthSelectOrCreate().createBasicAuth('test', 'test');
gitRepoCreatePage.setHelmRepoURLRegex(helmRepoURLRegex);

// #Percy tests
cy.get('span:contains("Enable Self-Healing") ~ i.icon-info').realHover();
cy.wait(500);
cy.percySnapshot('Self-Healing test');

cy.get('span:contains("Always Keep Resource") ~ i.icon-info').realHover();
cy.wait(500);
cy.percySnapshot('Always Keep Resource test');

cy.get('h3:contains("Paths ") > i.icon-info').realHover();
cy.wait(500);
cy.percySnapshot('Paths test');

gitRepoCreatePage.gitRepoPaths().setValueAtIndex(paths[0], 0);
gitRepoCreatePage.goToNext();

Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@
"cy:e2e": "cypress open --e2e --browser chrome",
"cy:open": "cypress open",
"cy:run": "cypress run --browser chrome",
"cy:run:percy": "npx percy exec -- cypress run --browser chrome --spec cypress/e2e/tests/pages/generic/login.spec.ts",
"cy:run:percy": "npx percy exec -- cypress run --browser chrome --spec cypress/e2e/tests/pages/fleet/gitrepo.spec.ts",
"cy:run:sorry": "./scripts/e2e $SPEC_FILE",
"e2e:pre-dev": "yarn docker:local:stop && yarn docker:local:start && NODE_ENV=dev TEST_INSTRUMENT=true yarn build",
"e2e:dev": "START_SERVER_AND_TEST_INSECURE=1 server-test start:dev https-get://localhost:8005 cy:run:sorry",
"e2e:build": "mkdir dist && TEST_INSTRUMENT=false ./scripts/build-e2e",
"e2e:docker": "yarn docker:local:stop && ./scripts/e2e-docker-start $RANCHER_VERSION_E2E",
"e2e:prod": "BUILD_DASHBOARD=$BUILD_DASHBOARD GREP_TAGS=$GREP_TAGS TEST_USERNAME=$TEST_USERNAME TEST_BASE_URL=https://127.0.0.1/dashboard yarn cy:run",
"e2e:prod": "BUILD_DASHBOARD=$BUILD_DASHBOARD GREP_TAGS=$GREP_TAGS TEST_USERNAME=$TEST_USERNAME TEST_BASE_URL=https://127.0.0.1/dashboard yarn cy:run",
"coverage": "npx nyc merge coverage coverage/coverage.json",
"storybook": "cd storybook && yarn storybook",
"build-storybook": "cd storybook && yarn install --no-lockfile && NODE_OPTIONS=--max_old_space_size=4096 yarn build-storybook --quiet",
Expand Down Expand Up @@ -176,6 +176,7 @@
"cypress": "11.1.0",
"cypress-delete-downloads-folder": "0.0.4",
"cypress-mochawesome-reporter": "^3.8.2",
"cypress-real-events": "^1.14.0",
"eslint": "7.32.0",
"eslint-config-standard": "16.0.3",
"eslint-import-resolver-node": "0.3.4",
Expand Down Expand Up @@ -208,4 +209,4 @@
"resolutions": {
"html-webpack-plugin": "^5.0.0"
}
}
}
Loading