{"id":16988611,"url":"https://github.com/konghayao/cypress-template","last_synced_at":"2025-03-22T02:41:03.577Z","repository":{"id":226553840,"uuid":"769009325","full_name":"KonghaYao/Cypress-Template","owner":"KonghaYao","description":"It's a cypress template including action recording, assertion codegen, virtual test and multi environment presets! ","archived":false,"fork":false,"pushed_at":"2024-03-08T07:10:41.000Z","size":10,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-26T20:46:40.114Z","etag":null,"topics":["assertions","codegen","cypress","multi-environment","testing-tools","visualtesting"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KonghaYao.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-03-08T06:42:33.000Z","updated_at":"2024-03-08T07:05:45.000Z","dependencies_parsed_at":"2024-03-08T08:24:37.734Z","dependency_job_id":"11c49113-8e10-41c7-919e-07724ecc9b45","html_url":"https://github.com/KonghaYao/Cypress-Template","commit_stats":null,"previous_names":["konghayao/cypress-template"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KonghaYao%2FCypress-Template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KonghaYao%2FCypress-Template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KonghaYao%2FCypress-Template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KonghaYao%2FCypress-Template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KonghaYao","download_url":"https://codeload.github.com/KonghaYao/Cypress-Template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244898407,"owners_count":20528335,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["assertions","codegen","cypress","multi-environment","testing-tools","visualtesting"],"created_at":"2024-10-14T03:04:25.806Z","updated_at":"2025-03-22T02:41:03.558Z","avatar_url":"https://github.com/KonghaYao.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cypress Test Template\n\n## Test Like a Human: Click and Copy, We'll Generate the Rest!\n\n\n\n\n\n\n## Getting Start\n\n1. init repo\n\n```sh\ngit lfs install\n\nnpm config set sharp_binary_host \"https://npmmirror.com/mirrors/sharp\"\nnpm config set sharp_libvips_binary_host \"https://npmmirror.com/mirrors/sharp-libvips\"\n\npnpm i\n\npnpm e2e --system=ui.dev # start system\n\n```\n\n2.  Add System tag \n\n```js\n// scripts/start.js\n/** 环境配置 */\nconst config = {\n    // system tag\n    ui: {\n        // environment tag\n        dev: 'https://localhost:6066',\n        uat: 'https://uat.example.com',\n    },\n};\n```\n\n3. implement login method in `cypress/support/e2e.js`\n\nYou can create a default login username and password in `.env` file.\n\n```js\nexport const login = (username, password) =\u003e {\n    username = username || Cypress.env('USERNAME');\n    password = password || Cypress.env('PASSWORD');\n    cy.session(\n        username,\n        () =\u003e {\n            cy.on('uncaught:exception', (err, runnable) =\u003e {\n                // returning false here prevents Cypress from\n                // failing the test\n                return false;\n            });\n            // Place write a process to login\n            // cy.visit('https://example.login.com/login?service=' + Cypress.env('BASE'));\n\n            // cy.get('#username').type(username);\n            // cy.get('#password').type(password);\n            // cy.get('.login-button').click();\n        },\n        {\n            cacheAcrossSpecs: true,\n        },\n    );\n};\n```\n\n4. Start System \n\n```sh\npnpm e2e --system=ui.dev # start system\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkonghayao%2Fcypress-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkonghayao%2Fcypress-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkonghayao%2Fcypress-template/lists"}