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
npm install cypress-plugin-stripe-elements
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
37 Stars
38 Commits
5 Forks
3 Watching
2 Branches
3 Contributors
Updated on 02 Jul 2024
JavaScript (67.65%)
TypeScript (32.35%)
Cumulative downloads
Total Downloads
Last day
-16.3%
6,526
Compared to previous day
Last week
-5.3%
37,260
Compared to previous week
Last month
-12%
163,861
Compared to previous month
Last year
21.2%
2,052,699
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
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
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
22 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-25
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