Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
AutomationTestForUnibee
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Joshua Yu
AutomationTestForUnibee
Commits
28eeae38
Commit
28eeae38
authored
Aug 12, 2024
by
YuShijiaCode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update code
parent
23e4cd7e
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
6 deletions
+39
-6
05_invoice.js
01_Web/TestCases/MerchantPortal/05_invoice.js
+0
-0
06_transaction.js
01_Web/TestCases/MerchantPortal/06_transaction.js
+38
-5
08_subscription.js
01_Web/TestCases/MerchantPortal/08_subscription.js
+1
-1
No files found.
01_Web/TestCases/MerchantPortal/05_invoice.js
View file @
28eeae38
This diff is collapsed.
Click to expand it.
01_Web/TestCases/MerchantPortal/06_transaction.js
View file @
28eeae38
...
@@ -142,6 +142,35 @@ describe('case01: Transaction with Succeeded=> Success', function () {
...
@@ -142,6 +142,35 @@ describe('case01: Transaction with Succeeded=> Success', function () {
}
}
});
});
it
(
'Case 04: update user country => Success'
,
(
done
)
=>
{
try
{
setTimeout
(()
=>
{
//Wait syncTimeAPI*1000 seconds
ApiReq
.
updateUserCountry
(
API_Env
.
get
().
headerSet
,
{
"countryCode"
:
"GB"
,
"countryName"
:
"United Kingdom"
,
"userId"
:
testData
[
'id'
]
},
(
res
,
url
,
header
,
bodyObject
)
=>
{
request
=
JSON
.
stringify
(
bodyObject
);
request
=
{
URL
:
url
,
Headers
:
header
,
Body
:
JSON
.
parse
(
request
)
};
// response = res.body;
// Expect response headers:x-app,Content-Type
expect
(
res
.
statusCode
).
to
.
equal
(
200
);
const
resBody
=
JSON
.
parse
(
res
.
body
);
response
=
resBody
;
console
.
log
(
resBody
)
// // token check
expect
(
resBody
.
code
).
to
.
equal
(
0
);
done
();
});
},
1000
);
}
catch
(
e
)
{
done
(
e
);
}
});
it
(
'case 05 -Transaction with Succeeded => Success '
,
(
done
)
=>
{
it
(
'case 05 -Transaction with Succeeded => Success '
,
(
done
)
=>
{
(
async
()
=>
{
(
async
()
=>
{
...
@@ -155,6 +184,7 @@ describe('case01: Transaction with Succeeded=> Success', function () {
...
@@ -155,6 +184,7 @@ describe('case01: Transaction with Succeeded=> Success', function () {
await
baseStep
.
waitUntilElement
(
Driver
,
loginPage
.
user_email
,
20000
);
await
baseStep
.
waitUntilElement
(
Driver
,
loginPage
.
user_email
,
20000
);
await
loginPage
.
loginUserPortal
(
Driver
,
testUser
)
await
loginPage
.
loginUserPortal
(
Driver
,
testUser
)
await
baseStep
.
wait
(
Driver
,
1000
);
await
baseStep
.
wait
(
Driver
,
1000
);
await
baseStep
.
click
(
Driver
,
userPlanPage
.
menu_plan
);
await
baseStep
.
waitUntilElement
(
Driver
,
userPlanPage
.
plan_page_sign
,
20000
);
await
baseStep
.
waitUntilElement
(
Driver
,
userPlanPage
.
plan_page_sign
,
20000
);
await
userPlanPage
.
selectPlan
(
Driver
,
'Month Plan'
);
await
userPlanPage
.
selectPlan
(
Driver
,
'Month Plan'
);
await
baseStep
.
waitUntilElement
(
Driver
,
userPlanPage
.
bank_card
,
20000
);
await
baseStep
.
waitUntilElement
(
Driver
,
userPlanPage
.
bank_card
,
20000
);
...
@@ -200,7 +230,7 @@ describe('case01: Transaction with Succeeded=> Success', function () {
...
@@ -200,7 +230,7 @@ describe('case01: Transaction with Succeeded=> Success', function () {
await
baseStep
.
click
(
Driver
,
merchantTransactionPage
.
menu_transaction
);
await
baseStep
.
click
(
Driver
,
merchantTransactionPage
.
menu_transaction
);
await
baseStep
.
wait
(
Driver
,
2000
);
await
baseStep
.
wait
(
Driver
,
2000
);
await
baseStep
.
screenShot
(
Driver
,
savaPath
+
'/01_SuccessTransaction.jpeg'
);
await
baseStep
.
screenShot
(
Driver
,
savaPath
+
'/01_SuccessTransaction.jpeg'
);
await
merchantTransactionPage
.
checkRecordTransactionList
(
Driver
,
"€24
.4"
,
"Succeeded"
,
"Payment"
,
"s
tripe"
);
await
merchantTransactionPage
.
checkRecordTransactionList
(
Driver
,
"€24
"
,
"Succeeded"
,
"Payment"
,
"S
tripe"
);
done
();
done
();
}
catch
(
e
)
{
}
catch
(
e
)
{
...
@@ -346,6 +376,7 @@ describe('case02: Transaction with Pending=> Success', function () {
...
@@ -346,6 +376,7 @@ describe('case02: Transaction with Pending=> Success', function () {
await
baseStep
.
waitUntilElement
(
Driver
,
loginPage
.
user_email
,
20000
);
await
baseStep
.
waitUntilElement
(
Driver
,
loginPage
.
user_email
,
20000
);
await
loginPage
.
loginUserPortal
(
Driver
,
testUser
)
await
loginPage
.
loginUserPortal
(
Driver
,
testUser
)
await
baseStep
.
wait
(
Driver
,
1000
);
await
baseStep
.
wait
(
Driver
,
1000
);
await
baseStep
.
click
(
Driver
,
userPlanPage
.
menu_plan
);
await
baseStep
.
waitUntilElement
(
Driver
,
userPlanPage
.
plan_page_sign
,
20000
);
await
baseStep
.
waitUntilElement
(
Driver
,
userPlanPage
.
plan_page_sign
,
20000
);
await
userPlanPage
.
selectPlan
(
Driver
,
'Month Plan'
);
await
userPlanPage
.
selectPlan
(
Driver
,
'Month Plan'
);
await
baseStep
.
click
(
Driver
,
userPlanPage
.
wire_transfer
);
await
baseStep
.
click
(
Driver
,
userPlanPage
.
wire_transfer
);
...
@@ -384,7 +415,7 @@ describe('case02: Transaction with Pending=> Success', function () {
...
@@ -384,7 +415,7 @@ describe('case02: Transaction with Pending=> Success', function () {
await
baseStep
.
click
(
Driver
,
merchantTransactionPage
.
menu_transaction
);
await
baseStep
.
click
(
Driver
,
merchantTransactionPage
.
menu_transaction
);
await
baseStep
.
wait
(
Driver
,
2000
);
await
baseStep
.
wait
(
Driver
,
2000
);
await
baseStep
.
screenShot
(
Driver
,
savaPath
+
'/02_PendingTransaction.jpeg'
);
await
baseStep
.
screenShot
(
Driver
,
savaPath
+
'/02_PendingTransaction.jpeg'
);
await
merchantTransactionPage
.
checkRecordTransactionList
(
Driver
,
"€24
.4
"
,
"Pending"
,
"Payment"
,
"Wire Transfer"
);
await
merchantTransactionPage
.
checkRecordTransactionList
(
Driver
,
"€24"
,
"Pending"
,
"Payment"
,
"Wire Transfer"
);
done
();
done
();
...
@@ -532,6 +563,7 @@ describe('case03: Transaction with Failed=> Success', function () {
...
@@ -532,6 +563,7 @@ describe('case03: Transaction with Failed=> Success', function () {
await
baseStep
.
waitUntilElement
(
Driver
,
loginPage
.
user_email
,
20000
);
await
baseStep
.
waitUntilElement
(
Driver
,
loginPage
.
user_email
,
20000
);
await
loginPage
.
loginUserPortal
(
Driver
,
testUser
)
await
loginPage
.
loginUserPortal
(
Driver
,
testUser
)
await
baseStep
.
wait
(
Driver
,
1000
);
await
baseStep
.
wait
(
Driver
,
1000
);
await
baseStep
.
click
(
Driver
,
userPlanPage
.
menu_plan
);
await
baseStep
.
waitUntilElement
(
Driver
,
userPlanPage
.
plan_page_sign
,
20000
);
await
baseStep
.
waitUntilElement
(
Driver
,
userPlanPage
.
plan_page_sign
,
20000
);
await
userPlanPage
.
selectPlan
(
Driver
,
'Month Plan'
);
await
userPlanPage
.
selectPlan
(
Driver
,
'Month Plan'
);
await
baseStep
.
click
(
Driver
,
userPlanPage
.
wire_transfer
);
await
baseStep
.
click
(
Driver
,
userPlanPage
.
wire_transfer
);
...
@@ -573,7 +605,7 @@ describe('case03: Transaction with Failed=> Success', function () {
...
@@ -573,7 +605,7 @@ describe('case03: Transaction with Failed=> Success', function () {
await
baseStep
.
click
(
Driver
,
merchantTransactionPage
.
menu_transaction
);
await
baseStep
.
click
(
Driver
,
merchantTransactionPage
.
menu_transaction
);
await
baseStep
.
wait
(
Driver
,
2000
);
await
baseStep
.
wait
(
Driver
,
2000
);
await
baseStep
.
screenShot
(
Driver
,
savaPath
+
'/03_FailedTransaction.jpeg'
);
await
baseStep
.
screenShot
(
Driver
,
savaPath
+
'/03_FailedTransaction.jpeg'
);
await
merchantTransactionPage
.
checkRecordTransactionList
(
Driver
,
"€24
.4
"
,
"Failed"
,
"Payment"
,
"Wire Transfer"
);
await
merchantTransactionPage
.
checkRecordTransactionList
(
Driver
,
"€24"
,
"Failed"
,
"Payment"
,
"Wire Transfer"
);
done
();
done
();
...
@@ -721,6 +753,7 @@ describe('case04: Transaction with refund => Success', function () {
...
@@ -721,6 +753,7 @@ describe('case04: Transaction with refund => Success', function () {
await
baseStep
.
waitUntilElement
(
Driver
,
loginPage
.
user_email
,
20000
);
await
baseStep
.
waitUntilElement
(
Driver
,
loginPage
.
user_email
,
20000
);
await
loginPage
.
loginUserPortal
(
Driver
,
testUser
)
await
loginPage
.
loginUserPortal
(
Driver
,
testUser
)
await
baseStep
.
wait
(
Driver
,
1000
);
await
baseStep
.
wait
(
Driver
,
1000
);
await
baseStep
.
click
(
Driver
,
userPlanPage
.
menu_plan
);
await
baseStep
.
waitUntilElement
(
Driver
,
userPlanPage
.
plan_page_sign
,
20000
);
await
baseStep
.
waitUntilElement
(
Driver
,
userPlanPage
.
plan_page_sign
,
20000
);
await
userPlanPage
.
selectPlan
(
Driver
,
'Month Plan'
);
await
userPlanPage
.
selectPlan
(
Driver
,
'Month Plan'
);
await
baseStep
.
waitUntilElement
(
Driver
,
userPlanPage
.
bank_card
,
20000
);
await
baseStep
.
waitUntilElement
(
Driver
,
userPlanPage
.
bank_card
,
20000
);
...
@@ -772,7 +805,7 @@ describe('case04: Transaction with refund => Success', function () {
...
@@ -772,7 +805,7 @@ describe('case04: Transaction with refund => Success', function () {
await
baseStep
.
refreshPage
(
Driver
);
await
baseStep
.
refreshPage
(
Driver
);
await
merchantInvoicePage
.
checkRecordInvoiceList
(
Driver
,
await
merchantInvoicePage
.
checkRecordInvoiceList
(
Driver
,
"-€1"
,
"Credit Note"
,
"Refunded"
,
"
s
tripe"
,
testUser
);
"-€1"
,
"Credit Note"
,
"Refunded"
,
"
S
tripe"
,
testUser
);
done
();
done
();
...
@@ -800,7 +833,7 @@ describe('case04: Transaction with refund => Success', function () {
...
@@ -800,7 +833,7 @@ describe('case04: Transaction with refund => Success', function () {
await
baseStep
.
click
(
Driver
,
merchantTransactionPage
.
menu_transaction
);
await
baseStep
.
click
(
Driver
,
merchantTransactionPage
.
menu_transaction
);
await
baseStep
.
wait
(
Driver
,
2000
);
await
baseStep
.
wait
(
Driver
,
2000
);
await
baseStep
.
screenShot
(
Driver
,
savaPath
+
'/04_RefundTransaction.jpeg'
);
await
baseStep
.
screenShot
(
Driver
,
savaPath
+
'/04_RefundTransaction.jpeg'
);
await
merchantTransactionPage
.
checkRecordTransactionList
(
Driver
,
"€1"
,
"Succeeded"
,
"Refund"
,
"
s
tripe"
);
await
merchantTransactionPage
.
checkRecordTransactionList
(
Driver
,
"€1"
,
"Succeeded"
,
"Refund"
,
"
S
tripe"
);
done
();
done
();
...
...
01_Web/TestCases/MerchantPortal/08_subscription.js
View file @
28eeae38
...
@@ -12,7 +12,7 @@ const baseStep = require('../../../CommonStep/Web/Web_Common_Step');
...
@@ -12,7 +12,7 @@ const baseStep = require('../../../CommonStep/Web/Web_Common_Step');
const
API_Object
=
require
(
"../../../CommonStep/API/API_Object"
);
const
API_Object
=
require
(
"../../../CommonStep/API/API_Object"
);
const
API_Env
=
require
(
"../../../CommonStep/API/API_Env"
);
const
API_Env
=
require
(
"../../../CommonStep/API/API_Env"
);
const
ApiReq
=
new
API_Object
(
"http
://localhost:8088
"
);
const
ApiReq
=
new
API_Object
(
"http
s://api.unibee.top
"
);
const
addContext
=
require
(
'mochawesome/addContext'
);
const
addContext
=
require
(
'mochawesome/addContext'
);
const
{
expect
}
=
require
(
"chai"
);
const
{
expect
}
=
require
(
"chai"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment