Skip to content

Commit

Permalink
ADM-651:[frontend] [backend] [stub] Do some refactorings for e2e (#794)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zxx-Ivy authored Dec 7, 2023
2 parents 7d0ea24 + 7643c51 commit fc53e4f
Show file tree
Hide file tree
Showing 6 changed files with 186 additions and 98 deletions.
39 changes: 19 additions & 20 deletions frontend/cypress/e2e/createANewProject.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,29 @@ import reportPage from '../pages/metrics/report'

const cycleTimeData = [
{ label: 'Name', value: 'Value' },
{ label: 'Average cycle time', value: '7.64(days/SP)' },
{ label: '9.55(days/card)' },
{ label: 'Total development time / Total cycle time', value: '62.04%' },
{ label: 'Total waiting for testing time / Total cycle time', value: '2.39%' },
{ label: 'Total block time / Total cycle time', value: '30.27%' },
{ label: 'Total review time / Total cycle time', value: '3.82%' },
{ label: 'Total testing time / Total cycle time', value: '1.48%' },
{ label: 'Average cycle time', value: '6.75(days/SP)' },
{ label: '9.85(days/card)' },
{ label: 'Total development time / Total cycle time', value: '70.13%' },
{ label: 'Total waiting for testing time / Total cycle time', value: '2.7%' },
{ label: 'Total block time / Total cycle time', value: '21.17%' },
{ label: 'Total review time / Total cycle time', value: '4.32%' },
{ label: 'Total testing time / Total cycle time', value: '1.68%' },
{ label: 'Average development time', value: '4.74(days/SP)' },
{ label: '5.92(days/card)' },
{ label: '6.91(days/card)' },
{ label: 'Average waiting for testing time', value: '0.18(days/SP)' },
{ label: '0.23(days/card)' },
{ label: 'Average block time', value: '2.31(days/SP)' },
{ label: '2.89(days/card)' },
{ label: '0.27(days/card)' },
{ label: 'Average block time', value: '1.43(days/SP)' },
{ label: '2.09(days/card)' },
{ label: 'Average review time', value: '0.29(days/SP)' },
{ label: '0.37(days/card)' },
{ label: '0.43(days/card)' },
{ label: 'Average testing time', value: '0.11(days/SP)' },
{ label: '0.14(days/card)' },
{ label: '0.17(days/card)' },
]

const velocityData = [
{ label: 'Name', value: 'Value' },
{ label: 'Velocity(Story Point)', value: '17.5' },
{ label: 'Throughput(Cards Count)', value: '14' },
{ label: 'Throughput(Cards Count)', value: '12' },
]

const metricsTextList = [
Expand Down Expand Up @@ -177,9 +177,9 @@ const clearDownloadFile = () => {
const checkMetricCSV = () => {
cy.wait(2000)
cy.fixture('metric.csv').then((localFileContent) => {
cy.task('readDir', 'cypress/downloads').then((files) => {
cy.task('readDir', 'cypress/downloads').then((files: string[]) => {
expect(files).to.match(new RegExp(/metric-.*\.csv/))
files.forEach((file) => {
files.forEach((file: string) => {
if (file.match(/metric-.*\.csv/)) {
cy.readFile(`cypress/downloads/${file}`).then((fileContent) => {
expect(fileContent).to.contains(localFileContent)
Expand Down Expand Up @@ -253,7 +253,6 @@ describe('Create a new project', () => {

configPage.fillBoardInfoAndVerifyWithClassicJira('1963', 'test@test.com', 'PLL', 'site', 'mockToken')

cy.wait(6000)
cy.contains('Verified').should('exist')
cy.contains('Reset').should('exist')

Expand Down Expand Up @@ -288,7 +287,7 @@ describe('Create a new project', () => {

metricsPage.goReportStep()

cy.wait(20000)
reportPage.waitingForProgressBar()

checkVelocity('[data-test-id="Velocity"]', velocityData)

Expand Down Expand Up @@ -364,7 +363,7 @@ describe('Create a new project', () => {

metricsPage.goReportStep()

cy.wait(20000)
reportPage.waitingForProgressBar()

reportPage.backToMetricsStep()

Expand Down Expand Up @@ -397,7 +396,7 @@ describe('Create a new project', () => {

metricsPage.goReportStep()

cy.wait(20000)
reportPage.waitingForProgressBar()

reportPage.checkNotification()
})
Expand Down
8 changes: 6 additions & 2 deletions frontend/cypress/e2e/importAProject.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,16 @@ describe('Import project from file', () => {

configPage.verifyAndClickNextToMetrics()

configPage.waitingForProgressBar()

configPage.goMetricsStep()

checkFieldsExist(metricsTextList)
checkAutoCompleteFieldsExist(metricsAutoCompleteTextList)

metricsPage.goReportStep()

cy.wait(20000)
reportPage.waitingForProgressBar()

checkMeanTimeToRecovery('[data-test-id="Mean Time To Recovery"]')

Expand Down Expand Up @@ -151,6 +153,8 @@ describe('Import project from file', () => {

configPage.verifyAndClickNextToMetrics()

configPage.waitingForProgressBar()

configPage.goMetricsStep()

checkFieldsExist(metricsTextList)
Expand All @@ -159,7 +163,7 @@ describe('Import project from file', () => {

metricsPage.goReportStep()

cy.wait(20000)
reportPage.waitingForProgressBar()

checkMeanTimeToRecovery('[data-test-id="Mean Time To Recovery"]')

Expand Down
210 changes: 136 additions & 74 deletions frontend/cypress/fixtures/metric.csv
Original file line number Diff line number Diff line change
@@ -1,87 +1,149 @@
"Group","Metrics","Value"
"Velocity","Velocity(Story Point)","17.5"
"Velocity","Throughput(Cards Count)","14"
"Cycle time","Average cycle time(days/storyPoint)","7.64"
"Cycle time","Average cycle time(days/card)","9.55"
"Cycle time","Total time / Total cycle time","2.39"
"Cycle time","Total development time / Total cycle time","62.04"
"Cycle time","Total block time / Total cycle time","30.27"
"Cycle time","Total review time / Total cycle time","3.82"
"Cycle time","Total testing time / Total cycle time","1.48"
"Velocity","Throughput(Cards Count)","12"
"Cycle time","Average cycle time(days/storyPoint)","6.75"
"Cycle time","Average cycle time(days/card)","9.85"
"Cycle time","Total time / Total cycle time","2.70"
"Cycle time","Total development time / Total cycle time","70.13"
"Cycle time","Total block time / Total cycle time","21.17"
"Cycle time","Total review time / Total cycle time","4.32"
"Cycle time","Total testing time / Total cycle time","1.68"
"Cycle time","Average time(days/storyPoint)","0.18"
"Cycle time","Average time(days/card)","0.23"
"Cycle time","Average time(days/card)","0.27"
"Cycle time","Average development time(days/storyPoint)","4.74"
"Cycle time","Average development time(days/card)","5.92"
"Cycle time","Average block time(days/storyPoint)","2.31"
"Cycle time","Average block time(days/card)","2.89"
"Cycle time","Average development time(days/card)","6.91"
"Cycle time","Average block time(days/storyPoint)","1.43"
"Cycle time","Average block time(days/card)","2.09"
"Cycle time","Average review time(days/storyPoint)","0.29"
"Cycle time","Average review time(days/card)","0.37"
"Cycle time","Average review time(days/card)","0.43"
"Cycle time","Average testing time(days/storyPoint)","0.11"
"Cycle time","Average testing time(days/card)","0.14"
"Classifications","Issue Type / Task","50.00"
"Classifications","Issue Type / FS Incidents","7.14"
"Classifications","Issue Type / Story","42.86"
"Classifications","Parent / PLL-1285","14.29"
"Classifications","Parent / PLL-1264","57.14"
"Classifications","Parent / PLL-634","28.57"
"Classifications","FS Domains / Payment Rails","7.14"
"Classifications","FS Domains / None","92.86"
"Cycle time","Average testing time(days/card)","0.17"
"Classifications","Issue Type / Task","58.33"
"Classifications","Issue Type / Story","41.67"
"Classifications","Parent / PLL-1285","16.67"
"Classifications","Parent / PLL-1264","66.67"
"Classifications","Parent / PLL-634","16.67"
"Classifications","FS Domains / None","100.00"
"Classifications","Components / None","100.00"
"Classifications","PIR Completed / N/A","7.14"
"Classifications","PIR Completed / None","92.86"
"Classifications","Team / Payment Rails (portfolio)","92.86"
"Classifications","Team / None","7.14"
"Classifications","PIR Completed / None","100.00"
"Classifications","Team / Payment Rails (portfolio)","100.00"
"Classifications","Project / FS Apollo","100.00"
"Classifications","Fix versions / Apple Pay Integration","14.29"
"Classifications","Fix versions / None","35.71"
"Classifications","Fix versions / Phoenix Credit Card Payment Migration","50.00"
"Classifications","Sprint / Apollo Sprint 65","64.29"
"Classifications","Fix versions / Apple Pay Integration","16.67"
"Classifications","Fix versions / None","25.00"
"Classifications","Fix versions / Phoenix Credit Card Payment Migration","58.33"
"Classifications","Sprint / Apollo Sprint 65","66.67"
"Classifications","Sprint / Apollo Sprint 66","100.00"
"Classifications","Sprint / Apollo Sprint 67","14.29"
"Classifications","Sprint / Apollo Sprint 68","14.29"
"Classifications","Sprint / Apollo Sprint 63","7.14"
"Classifications","Sprint / Apollo Sprint 64","14.29"
"Classifications","Resolution Details / It was resolved automatically. no action required.","7.14"
"Classifications","Resolution Details / None","92.86"
"Classifications","Epic Link / PLL-1285","14.29"
"Classifications","Epic Link / PLL-1264","57.14"
"Classifications","Epic Link / PLL-634","28.57"
"Classifications","Sprint / Apollo Sprint 63","8.33"
"Classifications","Sprint / Apollo Sprint 64","8.33"
"Classifications","Resolution Details / None","100.00"
"Classifications","Epic Link / PLL-1285","16.67"
"Classifications","Epic Link / PLL-1264","66.67"
"Classifications","Epic Link / PLL-634","16.67"
"Classifications","Epic Name / None","100.00"
"Classifications","Time to Resolution - Hrs / 1","7.14"
"Classifications","Time to Resolution - Hrs / None","92.86"
"Classifications","Time to Detect - Hrs / 1","7.14"
"Classifications","Time to Detect - Hrs / None","92.86"
"Classifications","Cause by - System / Others","7.14"
"Classifications","Cause by - System / None","92.86"
"Classifications","FS Work Categorization / Support Request","14.29"
"Classifications","FS Work Categorization / Stories","78.57"
"Classifications","FS Work Categorization / Incident handling","7.14"
"Classifications","Time to Resolution - Hrs / None","100.00"
"Classifications","Time to Detect - Hrs / None","100.00"
"Classifications","Cause by - System / None","100.00"
"Classifications","FS Work Categorization / Support Request","16.67"
"Classifications","FS Work Categorization / Stories","83.33"
"Classifications","Has Dependancies / None","100.00"
"Classifications","FS R&D Classification / Programs","78.57"
"Classifications","FS R&D Classification / Unplanned Operational","21.43"
"Classifications","FS Work Type / Feature Work - Unplanned","7.14"
"Classifications","FS Work Type / Operational Work - Unplanned","14.29"
"Classifications","FS Work Type / Operational Work - Planned","28.57"
"Classifications","FS Work Type / Feature Work - Planned","50.00"
"Classifications","FS R&D Classification / Programs","83.33"
"Classifications","FS R&D Classification / Unplanned Operational","16.67"
"Classifications","FS Work Type / Feature Work - Unplanned","8.33"
"Classifications","FS Work Type / Operational Work - Planned","33.33"
"Classifications","FS Work Type / Feature Work - Planned","58.33"
"Classifications","Incident Priority / P4","100.00"
"Classifications","Reporter / Anthony Tse","28.57"
"Classifications","Reporter / Bruce Lund","7.14"
"Classifications","Reporter / Yu Zhang","7.14"
"Classifications","Reporter / Gerard Ho","35.71"
"Classifications","Reporter / Qian Zhang","14.29"
"Classifications","Reporter / HanWei Wang","7.14"
"Classifications","Reporter / Anthony Tse","33.33"
"Classifications","Reporter / Yu Zhang","8.33"
"Classifications","Reporter / Gerard Ho","41.67"
"Classifications","Reporter / Qian Zhang","16.67"
"Classifications","Parent Link / None","100.00"
"Classifications","Priority / High","21.43"
"Classifications","Priority / Could","78.57"
"Classifications","Paired Member / Anthony Tse","7.14"
"Classifications","Paired Member / Harsh Singal","7.14"
"Classifications","Paired Member / Yu Zhang","7.14"
"Classifications","Paired Member / None","71.43"
"Classifications","Paired Member / HanWei Wang","7.14"
"Classifications","Labels / Tech_Usability_Issues","7.14"
"Classifications","Labels / Leave","14.29"
"Classifications","Labels / None","78.57"
"Classifications","Story Points / 0","28.57"
"Classifications","Story Points / 1","21.43"
"Classifications","Story Points / 2","42.86"
"Classifications","Story Points / 2.5","7.14"
"Classifications","Priority / High","25.00"
"Classifications","Priority / Could","75.00"
"Classifications","Paired Member / Anthony Tse","8.33"
"Classifications","Paired Member / Harsh Singal","8.33"
"Classifications","Paired Member / Yu Zhang","8.33"
"Classifications","Paired Member / None","75.00"
"Classifications","Labels / Tech_Usability_Issues","8.33"
"Classifications","Labels / Leave","16.67"
"Classifications","Labels / None","75.00"
"Classifications","Story Points / 0","16.67"
"Classifications","Story Points / 1","25.00"
"Classifications","Story Points / 2","50.00"
"Classifications","Story Points / 2.5","8.33"
"Classifications","Acceptance Criteria / To request the access for Yonghee based on the request template above","8.33"
"Classifications","Acceptance Criteria / * Successful transactions should be uploaded
* Unsuccessful transactions where response code is not null should be uploaded
* AUD and NZD transactions should be uploaded in separate folders","8.33"
"Classifications","Acceptance Criteria / * Add API test for this new rest endpoint.
* Add transaction into payment_transaction table
** create transaction status entries
*** Initialized
*** completed
*** failed
* Add into payment table
* Validate request body fields
** all not null
** currency value is AUD and NZD
* Cover Unhappy path:
** follow current OIP error handling for payment
** pass error message from FZ and forward to Phoenix in error message body.



Test Scenarios: [https://XXXXconfluence.atlassian.net/wiki/spaces/FSP/pages/8870461970/Card+Payment|https://XXXXconfluence.atlassian.net/wiki/spaces/FSP/pages/8870461970/Card+Payment|smart-link] ","8.33"
"Classifications","Acceptance Criteria / See this for more details: [https://XXXXconfluence.atlassian.net/wiki/spaces/FSP/pages/8864302061/Phoenix+FatZebra+Integration+-+Token+Migration+Plan|https://XXXXconfluence.atlassian.net/wiki/spaces/FSP/pages/8864302061/Phoenix+FatZebra+Integration+-+Token+Migration+Plan|smart-link] ","8.33"
"Classifications","Acceptance Criteria / # Change the title of this page.
{{Save card}}
# Add the XXXX logo beneath the card form
# Change success page. {{Card captured successfully}}","8.33"
"Classifications","Acceptance Criteria / * Happy path
* Error path (error alert)","8.33"
"Classifications","Acceptance Criteria / * Complete End to end flow with Phoenix","8.33"
"Classifications","Acceptance Criteria / * Create new endpoint to fetch token transaction info by using token_transaction_id
* Update postman collection
* API tests

Test Scenarios: [https://XXXXconfluence.atlassian.net/wiki/spaces/FSP/pages/8900084163/Fetch+token+transaction+information|https://XXXXconfluence.atlassian.net/wiki/spaces/FSP/pages/8900084163/Fetch+token+transaction+information|smart-link] ","8.33"
"Classifications","Acceptance Criteria / # Merchant Validation should be successful and use should be able to see the Payment Sheet with Button to Authorise the payment.
# !image-20220804-054828.png|width=467,height=288!


Test Scenarios
[https://XXXXconfluence.atlassian.net/wiki/spaces/FSP/pages/8887108205/Initiate+ApplePay+Payment+Processing|https://XXXXconfluence.atlassian.net/wiki/spaces/FSP/pages/8887108205/Initiate+ApplePay+Payment+Processing|smart-link] ","8.33"
"Classifications","Acceptance Criteria / * Able to generate a card token using Fat Zebra api in Merchant test UI application for all card types
* UI tests about tokenizing credit cards via FZ passed","8.33"
"Classifications","Acceptance Criteria / h4. Happy path

*Given* invoke Fatzebra API successfully

*When* a new merchant is onboarded to FatZebra

*Then* onboarding API return 200

*And* Fatzebra get APi return ACTIVE [https://docs.fatzebra.com/reference/check-get-an-apple-pay-on-the-web-domain|https://docs.fatzebra.com/reference/check-get-an-apple-pay-on-the-web-domain|smart-link]

h4. Unhappy path

*Given* invoke Fatzebra API failed

*When* a new merchant is onboarded to FatZebra

*Then* onboarding API return 500

*And* an Alert should be send to {{cr-apollo-alert}} channel","8.33"
"Classifications","Acceptance Criteria / To request the access for Brian based on the request template above","8.33"
"Classifications","Environment / None","100.00"
"Classifications","Affects versions / None","100.00"
"Classifications","Assignee / Yonghee Jeon Jeon","8.33"
"Classifications","Assignee / Brian Ong","8.33"
"Classifications","Assignee / Harsh Singal","16.67"
"Classifications","Assignee / Gerard Ho","16.67"
"Classifications","Assignee / Peihang Yu","8.33"
"Classifications","Assignee / Qian Zhang","16.67"
"Classifications","Assignee / Sumit Narang","25.00"
"Deployment frequency","fs-platform-payment-selector / RECORD RELEASE TO PROD / Deployment frequency(deployments/day)","2.36"
"Lead time for changes","fs-platform-payment-selector / RECORD RELEASE TO PROD / PR Lead Time","0"
"Lead time for changes","fs-platform-payment-selector / RECORD RELEASE TO PROD / Pipeline Lead Time","-4.87"
"Lead time for changes","fs-platform-payment-selector / RECORD RELEASE TO PROD / Total Lead Time","-4.87"
"Change failure rate","fs-platform-payment-selector / RECORD RELEASE TO PROD / Failure rate","49.02"
"Mean Time To Recovery","fs-platform-payment-selector / RECORD RELEASE TO PROD / Mean Time To Recovery","4.43"
9 changes: 8 additions & 1 deletion frontend/cypress/pages/metrics/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ class Config {

private readonly sourceControlVerifyButton = () => cy.get('[data-test-id="sourceControlVerifyButton"]')

private readonly progressBar = () => cy.get('[data-testid="loading-page"]', { timeout: 10000 })

private readonly cancelButton = () => cy.contains('Cancel')

private readonly goToMetricsStepButton = () => cy.contains('Next')
Expand Down Expand Up @@ -84,8 +86,8 @@ class Config {
this.boardInfoProjectKeyInput().type(projectKey)
this.boardInfoSiteInput().type(site)
this.boardInfoTokenInput().type(token)

this.boardInfoVerifyButton().click()
this.waitingForProgressBar()
}

fillPipelineToolFieldsInfoAndVerify(token: string) {
Expand Down Expand Up @@ -114,6 +116,11 @@ class Config {
goMetricsStep() {
this.goToMetricsStepButton().click()
}

waitingForProgressBar() {
this.progressBar().should('be.visible')
this.progressBar().should('not.exist')
}
}

const configPage = new Config()
Expand Down
Loading

0 comments on commit fc53e4f

Please sign in to comment.