-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feature/bundle-journeys-by-domain
- Loading branch information
Showing
40 changed files
with
693 additions
and
76 deletions.
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
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,11 @@ | ||
{ | ||
"headerKey": "x-sdbxaz-api-key", | ||
"headerValue": "apisandbox-d0d8278f-5fc5-46fb-5fc5-d0b6e1cc8059", | ||
"users": { | ||
"userWithNoContext": { | ||
"username": "sdbxaz-stg-criscross", | ||
"password": "GQXTZdIOsXeqBtjc", | ||
"fullName": "Christopher Cross" | ||
} | ||
} | ||
} |
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 @@ | ||
{} |
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 @@ | ||
export * from './transactions.mocks.api.data'; |
20 changes: 20 additions & 0 deletions
20
apps/golden-sample-app-e2e/data/mocks-data/transactions.mocks.api.data.ts
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,20 @@ | ||
import { | ||
TransactionListDataType, | ||
TransactionDetailDataType, | ||
} from '@backbase-gsa/transactions-journey/e2e-tests'; | ||
|
||
export const transactionListMockData: TransactionListDataType = { | ||
size: 10, | ||
searchExpectations: [ | ||
{ term: 'KLM', count: 7 }, | ||
{ term: 'cafe', count: 3 }, | ||
], | ||
}; | ||
|
||
export const transactionDetailMocksData: TransactionDetailDataType = { | ||
recipient: 'Hard Rock Cafe', | ||
category: 'Alcohol & Bars', | ||
description: 'Beer Bar Salt Lake', | ||
status: 'BILLED', | ||
id: '007jb5', | ||
}; |
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 @@ | ||
export * from './transactions.sandbox.api.data'; |
16 changes: 16 additions & 0 deletions
16
apps/golden-sample-app-e2e/data/sandbox-api-data/transactions.sandbox.api.data.ts
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,16 @@ | ||
import { | ||
TransactionListDataType, | ||
TransactionDetailDataType, | ||
} from '@backbase-gsa/transactions-journey/e2e-tests'; | ||
export const transactionListSandboxData: TransactionListDataType = { | ||
size: 10, | ||
searchExpectations: [{ term: 'pocket', count: 5 }], | ||
}; | ||
|
||
export const transactionDetailSandboxData: TransactionDetailDataType = { | ||
recipient: 'BP', | ||
category: 'Gasoline/Fuel', | ||
description: 'BP Global', | ||
status: 'BILLED', | ||
id: '8a82815f936800030193810b891452e0', | ||
}; |
42 changes: 42 additions & 0 deletions
42
apps/golden-sample-app-e2e/fixtures/transactions.fixture.ts
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,42 @@ | ||
import { testWithAuth as baseTest } from '../page-objects/test-runner'; | ||
import { mergeTests } from '@playwright/test'; | ||
import { | ||
TransactionFixture, | ||
test as transferTest, | ||
} from '@backbase-gsa/transactions-journey/e2e-tests'; | ||
import { | ||
transactionDetailMocksData, | ||
transactionListMockData, | ||
} from '../data/mocks-data'; | ||
import { | ||
transactionDetailSandboxData, | ||
transactionListSandboxData, | ||
} from '../data/sandbox-api-data'; | ||
import { TestEnvironment } from 'test.model'; | ||
|
||
// Transactions test data per Env type | ||
const testData: Partial< | ||
Record<TestEnvironment, Pick<TransactionFixture, 'detailsData' | 'listData'>> | ||
> = { | ||
// Mock data to run tests against mocks | ||
[TestEnvironment.MOCKS]: { | ||
detailsData: transactionDetailMocksData, | ||
listData: transactionListMockData, | ||
}, | ||
// Sandbox data to run tests against sandbox env | ||
[TestEnvironment.SANDBOX]: { | ||
detailsData: transactionDetailSandboxData, | ||
listData: transactionListSandboxData, | ||
}, | ||
}; | ||
|
||
export const test = mergeTests( | ||
baseTest, | ||
transferTest | ||
).extend<TransactionFixture>({ | ||
// overrode default data based on environment config | ||
detailsData: async ({ env }, use) => await use(testData[env]!.detailsData), | ||
listData: async ({ env }, use) => await use(testData[env]!.listData), | ||
// type of the user | ||
userType: 'userWithNoContext', | ||
}); |
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
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
This file was deleted.
Oops, something went wrong.
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,49 @@ | ||
import { expect } from '@playwright/test'; | ||
import { test } from '../page-objects/test-runner'; | ||
import { wrongUser } from '../data/credentials'; | ||
|
||
const i18n = { | ||
identity: { | ||
username: 'Username or email', | ||
password: 'Password', | ||
loginButton: 'Log in', | ||
error: | ||
'Incorrect username or passwordPlease check your details and try again', | ||
}, | ||
}; | ||
|
||
test.describe.configure({ mode: 'parallel' }); | ||
|
||
test.describe( | ||
'Login tests', | ||
{ tag: ['@feature', '@i18n', '@e2e', '@identity'] }, | ||
() => { | ||
test('Empty user name', async ({ identityPage }) => { | ||
identityPage.open(); | ||
await test.step('Validate Input fields labels', async () => { | ||
await expect | ||
.soft(identityPage.userNameLabel, { | ||
message: `Expect Username label: "${i18n.identity.username}"`, | ||
}) | ||
.toHaveText(i18n.identity.username); | ||
await expect | ||
.soft(identityPage.passwordLabel, { | ||
message: `Expect Password label: "${i18n.identity.password}"`, | ||
}) | ||
.toHaveText(i18n.identity.password); | ||
}); | ||
await test.step(`Fill in credentials: "${wrongUser.username}/${wrongUser.password}"`, async () => { | ||
await identityPage.userName.fill(wrongUser.username); | ||
await identityPage.password.fill(wrongUser.password); | ||
}); | ||
await test.step('Try to login"', async () => { | ||
await identityPage.loginButton.click(); | ||
}); | ||
await test.step('Validate Failed login error message', async () => { | ||
await expect(identityPage.errorMessage, { | ||
message: `Expect error message: "${i18n.identity.error}"`, | ||
}).toHaveText(i18n.identity.error); | ||
}); | ||
}); | ||
} | ||
); |
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,4 @@ | ||
import { test } from '../fixtures/transactions.fixture'; | ||
import { testTransactionDetails } from '@backbase-gsa/transactions-journey/e2e-tests'; | ||
|
||
testTransactionDetails(test); |
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,4 @@ | ||
import { test } from '../fixtures/transactions.fixture'; | ||
import { testTransactionsList } from '@backbase-gsa/transactions-journey/e2e-tests'; | ||
|
||
testTransactionsList(test); |
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
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,11 @@ | ||
import fs from 'fs'; | ||
|
||
export const readFile = <T>(path: string | undefined): T => { | ||
if (!path) { | ||
throw new Error( | ||
'Failed to read config file, since path to the file provided was "undefined"' | ||
); | ||
} | ||
const configContents = fs.readFileSync(path, 'utf-8'); | ||
return JSON.parse(configContents) as T; | ||
}; |
Oops, something went wrong.