{"id":15620373,"url":"https://github.com/dbalatero/cypress-plugin-stripe-elements","last_synced_at":"2025-04-13T18:14:43.140Z","repository":{"id":46950571,"uuid":"324420148","full_name":"dbalatero/cypress-plugin-stripe-elements","owner":"dbalatero","description":"A small Cypress plugin that assists you in filling in Stripe Elements inputs","archived":false,"fork":false,"pushed_at":"2022-12-03T22:35:13.000Z","size":346,"stargazers_count":37,"open_issues_count":7,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-10T04:59:33.007Z","etag":null,"topics":["cypress","cypress-plugin","e2e-testing","stripe","stripe-elements","testing","testing-tools","typescript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dbalatero.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-12-25T19:20:19.000Z","updated_at":"2024-12-02T15:03:58.000Z","dependencies_parsed_at":"2023-01-23T14:31:31.752Z","dependency_job_id":null,"html_url":"https://github.com/dbalatero/cypress-plugin-stripe-elements","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbalatero%2Fcypress-plugin-stripe-elements","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbalatero%2Fcypress-plugin-stripe-elements/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbalatero%2Fcypress-plugin-stripe-elements/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbalatero%2Fcypress-plugin-stripe-elements/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dbalatero","download_url":"https://codeload.github.com/dbalatero/cypress-plugin-stripe-elements/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248190500,"owners_count":21062282,"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":["cypress","cypress-plugin","e2e-testing","stripe","stripe-elements","testing","testing-tools","typescript"],"created_at":"2024-10-03T09:01:19.588Z","updated_at":"2025-04-13T18:14:43.118Z","avatar_url":"https://github.com/dbalatero.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cypress-plugin-stripe-elements\n\n\u003cimg src=\"assets/cover.jpg\" /\u003e\n\u003cp align=\"center\" style=\"align: center;\"\u003e\n  \u003cimg src=\"https://github.com/dbalatero/cypress-plugin-stripe-elements/workflows/End-to-end%20tests/badge.svg\" /\u003e \n\n  \u003cimg src=\"https://img.shields.io/github/stars/dbalatero/cypress-plugin-stripe-elements\" alt=\"Github Stars\" /\u003e\n\u003c/p\u003e\n\nThis plugin provides a `fillElementsInput` that makes it easy to fill out\nStripe Elements inputs without `cy.wait()` hacks or anything else.\n\n```es6\ncy.fillElementsInput('cardNumber', '4242424242424242');\n```\n\n## Installation\n\n```\nnpm install --save-dev cypress-plugin-stripe-elements\n# or\nyarn add --dev cypress-plugin-stripe-elements\n```\n\nSet `{ \"chromeWebSecurity\": false }` in your `cypress.json` file, or the plugin\nwill not work.\n\nImport the plugin in your `cypress/support/index.js` file:\n\n```es6\n// cypress/support/index.js\n\nimport 'cypress-plugin-stripe-elements';\n```\n\n### TypeScript\n\nMake sure to include the following `types` in your `tsconfig.json` file:\n\n```json \n{\n  \"compilerOptions\": {\n    \"types\": [\"cypress\", \"cypress-plugin-stripe-elements\"]\n  }\n}\n```\n\n## Usage\n\nThis package provides a `cy.fillElementsInput(name, value)` command.\n\nThe `name` parameter can be one of:\n\n* `cardNumber` - credit card number field\n* `cardExpiry` - credit card MM/YY expiry field\n* `cardCvc` - credit card 3-digit CVC field\n* `postalCode` - postal/ZIP code\n\nor any `string` value matching the `data-elements-stable-field-name` attribute\nof the Elements `\u003cinput\u003e` you want to target. Use the DevTools/inspector to\nfigure out the stable field name.\n\nThe `value` is whatever `string` you want to fill the field with.\n\n```es6\ndescribe('payment form', () =\u003e {\n  it('allows for a successful payment', () =\u003e {\n    cy.visit(`http://localhost:4000`);\n\n    // It's recommended to scope `fillElementsInput` to a specific container\n    // in case you have multiple Stripe Elements on the page.\n    cy.get('#card-element').within(() =\u003e {\n      cy.fillElementsInput('cardNumber', '4242424242424242');\n      cy.fillElementsInput('cardExpiry', '1025'); // MMYY\n      cy.fillElementsInput('cardCvc', '123');\n      cy.fillElementsInput('postalCode', '90210');\n    });\n\n    // Click your Pay button (yours is different)\n    // cy.get('#pay-button').click();\n\n    // TODO: Assert some success state\n  })\n})\n```\n\n## Development\n\nTo modify this plugin, `git clone` the repo and run `yarn install`. You can run\nthe tests with `yarn test` after setting the environment variables `CYPRESS_TEST_APP_PORT` and `STRIPE_PUBLISHABLE_KEY`:\n\n```\nCYPRESS_TEST_APP_PORT=4000 STRIPE_PUBLISHABLE_KEY=your_key_here yarn test\n```\n\n## Examples\n\n- [Local Demo from this repository](https://github.com/dbalatero/cypress-plugin-stripe-elements/blob/master/cypress/integration/basic_spec.ts\n- [Stripe Payments Demo - stripe official demo project](https://github.com/riccardogiorato/cypress-for-everything/blob/main/examples/stripe/cypress/integration/stripe-elements.ts)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbalatero%2Fcypress-plugin-stripe-elements","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdbalatero%2Fcypress-plugin-stripe-elements","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbalatero%2Fcypress-plugin-stripe-elements/lists"}