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
141e4d9e
Commit
141e4d9e
authored
Oct 01, 2024
by
YuShijiaCode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
6a87fa95
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
33 deletions
+38
-33
05_invoice.js
01_Web/TestCases/MerchantPortal/05_invoice.js
+1
-1
06_transaction.js
01_Web/TestCases/MerchantPortal/06_transaction.js
+36
-31
09_user_list.js
01_Web/TestCases/MerchantPortal/09_user_list.js
+1
-1
No files found.
01_Web/TestCases/MerchantPortal/05_invoice.js
View file @
141e4d9e
...
@@ -1134,7 +1134,7 @@ describe('case06: Filter => Success', function () {
...
@@ -1134,7 +1134,7 @@ describe('case06: Filter => Success', function () {
await
baseStep
.
screenShot
(
Driver
,
savaPath
+
'/09_filterStatus.jpeg'
);
await
baseStep
.
screenShot
(
Driver
,
savaPath
+
'/09_filterStatus.jpeg'
);
await
merchantInvoicePage
.
checkRecordInvoiceList
(
Driver
,
await
merchantInvoicePage
.
checkRecordInvoiceList
(
Driver
,
""
,
"Invoice"
,
"Cancelled"
,
"
Stripe
"
,
testUser
);
""
,
"Invoice"
,
"Cancelled"
,
""
,
testUser
);
done
();
done
();
}
catch
(
e
)
{
}
catch
(
e
)
{
...
...
01_Web/TestCases/MerchantPortal/06_transaction.js
View file @
141e4d9e
...
@@ -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
(
"
"
);
const
ApiReq
=
new
API_Object
(
"
https://api.unibee.top
"
);
const
addContext
=
require
(
'mochawesome/addContext'
);
const
addContext
=
require
(
'mochawesome/addContext'
);
const
{
expect
}
=
require
(
"chai"
);
const
{
expect
}
=
require
(
"chai"
);
...
@@ -514,36 +514,10 @@ describe('case03: Transaction with Failed=> Success', function () {
...
@@ -514,36 +514,10 @@ describe('case03: Transaction with Failed=> Success', function () {
const
resBody
=
JSON
.
parse
(
res
.
body
);
const
resBody
=
JSON
.
parse
(
res
.
body
);
response
=
resBody
;
response
=
resBody
;
console
.
log
(
resBody
);
console
.
log
(
resBody
);
testData
[
'subId'
]
=
resBody
.
data
.
subscriptions
[
0
].
user
.
subscriptionId
;
for
(
let
i
=
0
;
i
<
3
;
i
++
){
done
();
testData
[
'subId_'
+
i
]
=
resBody
.
data
.
subscriptions
[
i
].
subscription
.
subscriptionId
;
});
},
1000
);
}
catch
(
e
)
{
done
(
e
);
}
});
it
(
'Case 03: cancel sub => Success'
,
(
done
)
=>
{
}
try
{
setTimeout
(()
=>
{
//Wait syncTimeAPI*1000 seconds
ApiReq
.
cancelSubscription
(
API_Env
.
get
().
headerSet
,
{
"subscriptionId"
:
testData
[
'subId'
]
},
(
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
();
done
();
});
});
},
1000
);
},
1000
);
...
@@ -552,6 +526,37 @@ describe('case03: Transaction with Failed=> Success', function () {
...
@@ -552,6 +526,37 @@ describe('case03: Transaction with Failed=> Success', function () {
}
}
});
});
for
(
let
i
=
0
;
i
<
3
;
i
++
){
it
(
'Case 03: cancel sub => Success'
,
(
done
)
=>
{
try
{
setTimeout
(()
=>
{
//Wait syncTimeAPI*1000 seconds
ApiReq
.
cancelSubscription
(
API_Env
.
get
().
headerSet
,
{
"subscriptionId"
:
testData
[
'subId_'
+
i
]
},
(
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 failed => Success '
,
(
done
)
=>
{
it
(
'case 05 - Transaction with failed => Success '
,
(
done
)
=>
{
(
async
()
=>
{
(
async
()
=>
{
try
{
try
{
...
@@ -907,7 +912,7 @@ describe('case05: Transaction filter => Success', function () {
...
@@ -907,7 +912,7 @@ describe('case05: Transaction filter => Success', function () {
await
merchantTransactionPage
.
filterStatus
(
Driver
,
[
"Failed"
])
await
merchantTransactionPage
.
filterStatus
(
Driver
,
[
"Failed"
])
await
baseStep
.
wait
(
Driver
,
2000
);
await
baseStep
.
wait
(
Driver
,
2000
);
await
baseStep
.
screenShot
(
Driver
,
savaPath
+
'/05_RefundTransaction.jpeg'
);
await
baseStep
.
screenShot
(
Driver
,
savaPath
+
'/05_RefundTransaction.jpeg'
);
await
merchantTransactionPage
.
checkRecordTransactionList
(
Driver
,
""
,
"Failed"
,
"Payment"
,
"
Stripe
"
);
await
merchantTransactionPage
.
checkRecordTransactionList
(
Driver
,
""
,
"Failed"
,
"Payment"
,
""
);
done
();
done
();
...
...
01_Web/TestCases/MerchantPortal/09_user_list.js
View file @
141e4d9e
...
@@ -193,7 +193,6 @@ describe('case02: Assign subscription in user list=> Success', function () {
...
@@ -193,7 +193,6 @@ describe('case02: Assign subscription in user list=> Success', function () {
await
baseStep
.
click
(
Driver
,
userListPage
.
assign_OK_btn
);
await
baseStep
.
click
(
Driver
,
userListPage
.
assign_OK_btn
);
await
baseStep
.
wait
(
Driver
,
3000
);
await
baseStep
.
wait
(
Driver
,
3000
);
await
baseStep
.
screenShot
(
Driver
,
savaPath
+
"/08_assign_result.png"
);
await
baseStep
.
screenShot
(
Driver
,
savaPath
+
"/08_assign_result.png"
);
await
baseStep
.
compareText
(
Driver
,
userListPage
.
current_text
,
"Current Subscription"
);
await
baseStep
.
compareText
(
Driver
,
userListPage
.
current_plan
,
"Month Plan"
);
await
baseStep
.
compareText
(
Driver
,
userListPage
.
current_plan
,
"Month Plan"
);
await
baseStep
.
compareText
(
Driver
,
userListPage
.
current_plan_des
,
"Month Plan"
);
await
baseStep
.
compareText
(
Driver
,
userListPage
.
current_plan_des
,
"Month Plan"
);
await
baseStep
.
compareText
(
Driver
,
userListPage
.
current_status
,
"Incomplete"
);
await
baseStep
.
compareText
(
Driver
,
userListPage
.
current_status
,
"Incomplete"
);
...
@@ -698,6 +697,7 @@ describe('case08:Set country and vat number in user list=> Success', function ()
...
@@ -698,6 +697,7 @@ describe('case08:Set country and vat number in user list=> Success', function ()
await
baseStep
.
screenShot
(
Driver
,
savaPath
+
"/12_vat_number_country.png"
);
await
baseStep
.
screenShot
(
Driver
,
savaPath
+
"/12_vat_number_country.png"
);
await
baseStep
.
scrollIntoView
(
Driver
,
userListPage
.
save_btn
);
await
baseStep
.
scrollIntoView
(
Driver
,
userListPage
.
save_btn
);
await
baseStep
.
click
(
Driver
,
userListPage
.
save_btn
);
await
baseStep
.
click
(
Driver
,
userListPage
.
save_btn
);
await
baseStep
.
wait
(
Driver
,
1000
);
expect
(
await
baseStep
.
getText
(
Driver
,
userListPage
.
vat_error_message
)).
not
.
null
expect
(
await
baseStep
.
getText
(
Driver
,
userListPage
.
vat_error_message
)).
not
.
null
await
baseStep
.
wait
(
Driver
,
3000
);
await
baseStep
.
wait
(
Driver
,
3000
);
done
();
done
();
...
...
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