Gathering detailed insights and metrics for cypress-plugin-stripe-elements
Gathering detailed insights and metrics for cypress-plugin-stripe-elements
Gathering detailed insights and metrics for cypress-plugin-stripe-elements
Gathering detailed insights and metrics for cypress-plugin-stripe-elements
A small Cypress plugin that assists you in filling in Stripe Elements inputs
npm install cypress-plugin-stripe-elements
Typescript
Module System
Node Version
NPM Version
98.5
Supply Chain
94.8
Quality
75.2
Maintenance
100
Vulnerability
100
License
JavaScript (67.65%)
TypeScript (32.35%)
Total Downloads
6,543,483
Last Day
1,047
Last Week
32,833
Last Month
147,885
Last Year
1,958,667
MIT License
38 Stars
38 Commits
6 Forks
4 Watchers
2 Branches
3 Contributors
Updated on May 06, 2025
Minified
Minified + Gzipped
Latest Version
1.0.2
Package Id
cypress-plugin-stripe-elements@1.0.2
Unpacked Size
6.40 kB
Size
3.07 kB
File Count
5
NPM Version
6.9.0
Node Version
10.16.0
Cumulative downloads
Total Downloads
Last Day
-0.4%
1,047
Compared to previous day
Last Week
-13.9%
32,833
Compared to previous week
Last Month
-1.1%
147,885
Compared to previous month
Last Year
10.5%
1,958,667
Compared to previous year
4
This plugin provides a fillElementsInput
that makes it easy to fill out
Stripe Elements inputs without cy.wait()
hacks or anything else.
1cy.fillElementsInput('cardNumber', '4242424242424242');
npm install --save-dev cypress-plugin-stripe-elements
# or
yarn add --dev cypress-plugin-stripe-elements
Set { "chromeWebSecurity": false }
in your cypress.json
file, or the plugin
will not work.
Import the plugin in your cypress/support/index.js
file:
1// cypress/support/index.js 2 3import 'cypress-plugin-stripe-elements';
Make sure to include the following types
in your tsconfig.json
file:
1{ 2 "compilerOptions": { 3 "types": ["cypress", "cypress-plugin-stripe-elements"] 4 } 5}
This package provides a cy.fillElementsInput(name, value)
command.
The name
parameter can be one of:
cardNumber
- credit card number fieldcardExpiry
- credit card MM/YY expiry fieldcardCvc
- credit card 3-digit CVC fieldpostalCode
- postal/ZIP codeor any string
value matching the data-elements-stable-field-name
attribute
of the Elements <input>
you want to target. Use the DevTools/inspector to
figure out the stable field name.
The value
is whatever string
you want to fill the field with.
1describe('payment form', () => { 2 it('allows for a successful payment', () => { 3 cy.visit(`http://localhost:4000`); 4 5 // It's recommended to scope `fillElementsInput` to a specific container 6 // in case you have multiple Stripe Elements on the page. 7 cy.get('#card-element').within(() => { 8 cy.fillElementsInput('cardNumber', '4242424242424242'); 9 cy.fillElementsInput('cardExpiry', '1025'); // MMYY 10 cy.fillElementsInput('cardCvc', '123'); 11 cy.fillElementsInput('postalCode', '90210'); 12 }); 13 14 // Click your Pay button (yours is different) 15 // cy.get('#pay-button').click(); 16 17 // TODO: Assert some success state 18 }) 19})
To modify this plugin, git clone
the repo and run yarn install
. You can run
the tests with yarn test
after setting the environment variables CYPRESS_TEST_APP_PORT
and STRIPE_PUBLISHABLE_KEY
:
CYPRESS_TEST_APP_PORT=4000 STRIPE_PUBLISHABLE_KEY=your_key_here yarn test
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 2/16 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
security policy file not detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
25 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More