-
Notifications
You must be signed in to change notification settings - Fork 111
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
E2e test order cards #356
Open
ankitdas13
wants to merge
16
commits into
master
Choose a base branch
from
e2e_test_order_cards
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
E2e test order cards #356
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
a35e37a
version bump
ankitdas13 8663099
Merge branch 'master' of github.com:razorpay/razorpay-node
ankitdas13 ae75d79
Merge branch 'master' of github.com:razorpay/razorpay-node
ankitdas13 56226b4
add e2e test cases
ankitdas13 88501c0
Create prod_ci.yml
ankitdas13 a38bea9
Update prod_ci.yml
ankitdas13 aff1565
Update prod_ci.yml
ankitdas13 d6779b2
Update package.json
ankitdas13 493dc69
Update prod_ci.yml
ankitdas13 ecf8595
Merge branch 'master' into e2e_test_order_cards
ankitdas13 b1e476c
Update package.json
ankitdas13 28c1822
Update prod_ci.yml
ankitdas13 62f166e
Update razorpay.js
ankitdas13 51add49
Update razorpay.js
ankitdas13 10aa46c
Update razorpay.js
ankitdas13 2c6a210
Update package.json
ankitdas13 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: e2e prod test | ||
on: | ||
push: | ||
branches: | ||
- master | ||
tags: | ||
- v[0-9]+.[0-9]+.[0-9]+* | ||
pull_request: | ||
branches: | ||
- master | ||
jobs: | ||
test: | ||
name: Run tests and publish test coverage | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [18.x] | ||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: 'npm' | ||
- name: Install dependencies | ||
run: npm install | ||
- name: Run tests | ||
run: npm run env -- mocha --timeout 10000 --recursive --require babel-register test_prod/ | ||
env: | ||
API_KEY: ${{ secrets.API_KEY }} | ||
API_SECRET: ${{ secrets.API_SECRET }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
'use strict'; | ||
|
||
const Razorpay = require("../dist/razorpay"); | ||
let request = require('request-promise'); | ||
|
||
class RazorpayBeta extends Razorpay { | ||
constructor(options) { | ||
super(options) | ||
this.api.rq = request.defaults({ | ||
baseUrl: options.hostUrl, | ||
json: true, | ||
auth: { | ||
user: options.key_id, | ||
pass: options.key_secret | ||
} | ||
}) | ||
} | ||
} | ||
|
||
|
||
module.exports = new RazorpayBeta({ | ||
key_id: process.env.API_KEY || "", | ||
key_secret: process.env.API_SECRET || "", | ||
hostUrl : "https://api-web.dev.razorpay.in" | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
'use strict' | ||
|
||
var assert = require('assert'); | ||
const rzpInstance = require('../razorpay') | ||
const equal = require('deep-equal'); | ||
const { items } = require('../razorpay'); | ||
|
||
let addonId = null; | ||
|
||
describe('ADDON', () => { | ||
|
||
it('Fetch all addons', (done) => { | ||
|
||
rzpInstance.addons.all({ "count": 1 }).then((response) => { | ||
if (response.hasOwnProperty('items')) { | ||
if ('id' in response.items[0]) { | ||
addonId = response.items[0].id | ||
} | ||
} | ||
assert.ok(response.hasOwnProperty('count')) | ||
assert.ok(response.hasOwnProperty('items')) | ||
done() | ||
}).catch(err => console.log(err)) | ||
}) | ||
|
||
it('fetch order\'s payments', (done) => { | ||
rzpInstance.addons.fetch(addonId).then((response) => { | ||
assert.ok(response.hasOwnProperty('id')) | ||
done() | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
'use strict' | ||
|
||
var assert = require('assert'); | ||
const rzpInstance = require('../razorpay') | ||
const equal = require('deep-equal'); | ||
const { items } = require('../razorpay'); | ||
|
||
let cardId = "card_LcQgzpfvWP0UKF"; | ||
|
||
describe('CARDS', () => { | ||
it('fetch order\'s payments', (done) => { | ||
rzpInstance.cards.fetch(cardId).then((response) => { | ||
assert.ok(response.hasOwnProperty('id')) | ||
done() | ||
}) | ||
}) | ||
}) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should check for status code 200 here as well