-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
46 changed files
with
2,728 additions
and
63 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
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,27 @@ | ||
name: Playwright Tests | ||
on: | ||
push: | ||
branches: [ main, master ] | ||
pull_request: | ||
branches: [ main, master ] | ||
jobs: | ||
test: | ||
timeout-minutes: 60 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: lts/* | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Install Playwright Browsers | ||
run: npx playwright install --with-deps | ||
- name: Run Playwright tests | ||
run: npx playwright test | ||
- uses: actions/upload-artifact@v4 | ||
if: ${{ !cancelled() }} | ||
with: | ||
name: playwright-report | ||
path: playwright-report/ | ||
retention-days: 30 |
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,27 @@ | ||
name: Playwright Tests | ||
on: | ||
push: | ||
branches: [ main, master ] | ||
pull_request: | ||
branches: [ main, master ] | ||
jobs: | ||
test: | ||
timeout-minutes: 60 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: lts/* | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Install Playwright Browsers | ||
run: npx playwright install --with-deps | ||
- name: Run Playwright tests | ||
run: QASE_MODE=testops npx playwright test | ||
- uses: actions/upload-artifact@v4 | ||
if: ${{ !cancelled() }} | ||
with: | ||
name: playwright-report | ||
path: playwright-report/ | ||
retention-days: 30 |
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,34 @@ | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
env: | ||
QASE_TESTOPS_PROJECT: ${{ secrets.QASE_TESTOPS_PROJECT }} | ||
QASE_TESTOPS_API_TOKEN: ${{ secrets.QASE_TESTOPS_API_TOKEN }} | ||
QASE_ENVIRONMENT: ${{ secrets.QASE_ENVIRONMENT }} | ||
HEADLESS: true | ||
|
||
jobs: | ||
tests_e2e: | ||
name: Run end-to-end tests | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 60 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Install playwright browsers | ||
run: npx playwright install --with-deps | ||
- name: Run tests | ||
run: QASE_MODE=testops npx playwright test | ||
- uses: actions/upload-artifact@v4 | ||
if: ${{ !cancelled() }} | ||
with: | ||
name: playwright-report | ||
path: playwright-report/ | ||
retention-days: 30 |
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,34 @@ | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
env: | ||
QASE_TESTOPS_PROJECT: ${{ secrets.QASE_TESTOPS_PROJECT }} | ||
QASE_TESTOPS_API_TOKEN: ${{ secrets.QASE_TESTOPS_API_TOKEN }} | ||
QASE_ENVIRONMENT: ${{ secrets.QASE_ENVIRONMENT }} | ||
HEADLESS: true | ||
|
||
jobs: | ||
tests_e2e: | ||
name: Run end-to-end tests | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 60 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Install playwright browsers | ||
run: npx playwright install --with-deps | ||
- name: Run tests | ||
run: QASE_MODE=testops npx playwright test | ||
- uses: actions/upload-artifact@v4 | ||
if: ${{ !cancelled() }} | ||
with: | ||
name: playwright-report | ||
path: playwright-report/ | ||
retention-days: 30 |
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,81 @@ | ||
// Import the required modules | ||
import { faker } from '@faker-js/faker'; | ||
|
||
/** | ||
* Test Data: | ||
* Test data files store the input values and expected outputs used across test cases. | ||
* They help separate the test logic from the data, ensuring tests remain flexible | ||
* and reusable. By keeping data like form inputs, URLs, or expected messages in | ||
* dedicated files, you can easily update and manage values without changing the | ||
* test logic. This approach also allows for dynamic data generation using | ||
* libraries like Faker, and ensures test cases remain clean and focused on | ||
* behavior rather than hardcoded values. | ||
*/ | ||
|
||
// Test data for tests, static hardcoded and also autogenerated by faker | ||
export const testData = { | ||
|
||
// User credentials for login - hardcoded | ||
email: '[email protected]', | ||
password: '123456', | ||
|
||
// User credentials for login - generated by faker | ||
randomEmail: () => faker.internet.email(), | ||
randomPassword: () => faker.internet.password(), | ||
|
||
// Generate a random embargo reason | ||
randomEmbargoReason: () => faker.lorem.sentence(), | ||
|
||
// New upload test data | ||
upload: { | ||
recordTitle: () => faker.lorem.sentence(), // Function to generate a random title | ||
familyName: () => faker.lorem.word(), // Function to generate a random family name | ||
recordDescription: () => faker.lorem.paragraph(), // Function to generate a random description | ||
communityName: () => faker.lorem.word(), // Function to generate a random community name | ||
|
||
// Dynamic resource type - Select randomly from a list, ensuring it's not the same as the currently selected type | ||
resourceType: (currentlySelected: string | null): string => { | ||
const resourceTypes = [ | ||
'Image', | ||
'Video', | ||
'Dataset', | ||
'Other', | ||
'Audio', | ||
'Software', | ||
'Workflow', | ||
'Poster', | ||
'Model', | ||
'Lesson', | ||
'Event' | ||
]; | ||
|
||
// Filter out the currently selected type from the available types | ||
const availableTypes = currentlySelected | ||
? resourceTypes.filter(type => type !== currentlySelected) | ||
: resourceTypes; | ||
|
||
// Select a random type from the available types | ||
return faker.helpers.arrayElement(availableTypes); | ||
}, | ||
}, | ||
|
||
// Data for export selection tests | ||
export: { | ||
style: 'Harvard', // Hardcoded style option for the test | ||
exportOption: 'JSON-LD' // Hardcoded export option for the test | ||
}, | ||
|
||
// Method to get today's date plus one day in YYYY-MM-DD format | ||
getDatePlusOne: (): string => { | ||
const today = new Date(); | ||
const tomorrow = new Date(today); | ||
tomorrow.setDate(today.getDate() + 1); | ||
|
||
// Format the date as YYYY-MM-DD | ||
const year = tomorrow.getFullYear(); | ||
const month = String(tomorrow.getMonth() + 1).padStart(2, '0'); // Months are 0-based | ||
const day = String(tomorrow.getDate()).padStart(2, '0'); | ||
|
||
return `${year}-${month}-${day}`; | ||
} | ||
}; |
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,82 @@ | ||
// Import the required modules | ||
import { faker } from '@faker-js/faker'; | ||
|
||
/** | ||
* Test Data: | ||
* Test data files store the input values and expected outputs used across test cases. | ||
* They help separate the test logic from the data, ensuring tests remain flexible | ||
* and reusable. By keeping data like form inputs, URLs, or expected messages in | ||
* dedicated files, you can easily update and manage values without changing the | ||
* test logic. This approach also allows for dynamic data generation using | ||
* libraries like Faker, and ensures test cases remain clean and focused on | ||
* behavior rather than hardcoded values. | ||
*/ | ||
|
||
// Test data for tests, static hardcoded and also autogenerated by faker | ||
export const testData = { | ||
|
||
// User credentials for login - hardcoded | ||
email: '[email protected]', | ||
password: '123456', | ||
|
||
// User credentials for login - generated by faker | ||
randomEmail: () => faker.internet.email(), | ||
randomPassword: () => faker.internet.password(), | ||
|
||
// Generate a random embargo reason | ||
randomEmbargoReason: () => faker.lorem.sentence(), | ||
|
||
// New upload test data | ||
upload: { | ||
recordTitle: () => faker.lorem.sentence(), // Function to generate a random title | ||
familyName: () => faker.lorem.word(), // Function to generate a random family name | ||
recordDescription: () => faker.lorem.paragraph(), // Function to generate a random description | ||
communityName: () => faker.lorem.word(), // Function to generate a random community name | ||
communityIdentifier: () => faker.helpers.slugify(faker.lorem.sentence()), // Function to generate a random community identifier | ||
|
||
// Dynamic resource type - Select randomly from a list, ensuring it's not the same as the currently selected type | ||
resourceType: (currentlySelected: string | null): string => { | ||
const resourceTypes = [ | ||
'Image', | ||
'Video', | ||
'Dataset', | ||
'Other', | ||
'Audio', | ||
'Software', | ||
'Workflow', | ||
'Poster', | ||
'Model', | ||
'Lesson', | ||
'Event' | ||
]; | ||
|
||
// Filter out the currently selected type from the available types | ||
const availableTypes = currentlySelected | ||
? resourceTypes.filter(type => type !== currentlySelected) | ||
: resourceTypes; | ||
|
||
// Select a random type from the available types | ||
return faker.helpers.arrayElement(availableTypes); | ||
}, | ||
}, | ||
|
||
// Data for export selection tests | ||
export: { | ||
style: 'Harvard', // Hardcoded style option for the test | ||
exportOption: 'JSON-LD' // Hardcoded export option for the test | ||
}, | ||
|
||
// Method to get today's date plus one day in YYYY-MM-DD format | ||
getDatePlusOne: (): string => { | ||
const today = new Date(); | ||
const tomorrow = new Date(today); | ||
tomorrow.setDate(today.getDate() + 1); | ||
|
||
// Format the date as YYYY-MM-DD | ||
const year = tomorrow.getFullYear(); | ||
const month = String(tomorrow.getMonth() + 1).padStart(2, '0'); // Months are 0-based | ||
const day = String(tomorrow.getDate()).padStart(2, '0'); | ||
|
||
return `${year}-${month}-${day}`; | ||
} | ||
}; |
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,82 @@ | ||
// Import the required modules | ||
import { faker } from '@faker-js/faker'; | ||
|
||
/** | ||
* Test Data: | ||
* Test data files store the input values and expected outputs used across test cases. | ||
* They help separate the test logic from the data, ensuring tests remain flexible | ||
* and reusable. By keeping data like form inputs, URLs, or expected messages in | ||
* dedicated files, you can easily update and manage values without changing the | ||
* test logic. This approach also allows for dynamic data generation using | ||
* libraries like Faker, and ensures test cases remain clean and focused on | ||
* behavior rather than hardcoded values. | ||
*/ | ||
|
||
// Test data for tests, static hardcoded and also autogenerated by faker | ||
export const testData = { | ||
|
||
// User credentials for login - hardcoded | ||
email: '[email protected]', | ||
password: '123456', | ||
|
||
// User credentials for login - generated by faker | ||
randomEmail: () => faker.internet.email(), | ||
randomPassword: () => faker.internet.password(), | ||
|
||
// Generate a random embargo reason | ||
randomEmbargoReason: () => faker.lorem.sentence(), | ||
|
||
// New upload test data | ||
upload: { | ||
recordTitle: () => faker.lorem.sentence(), // Function to generate a random title | ||
familyName: () => faker.lorem.word(), // Function to generate a random family name | ||
recordDescription: () => faker.lorem.paragraph(), // Function to generate a random description | ||
communityName: () => faker.lorem.word(), // Function to generate a random community name | ||
communityIdentifier: () => faker.lorem.sentence(), // Function to generate a random community identifier | ||
|
||
// Dynamic resource type - Select randomly from a list, ensuring it's not the same as the currently selected type | ||
resourceType: (currentlySelected: string | null): string => { | ||
const resourceTypes = [ | ||
'Image', | ||
'Video', | ||
'Dataset', | ||
'Other', | ||
'Audio', | ||
'Software', | ||
'Workflow', | ||
'Poster', | ||
'Model', | ||
'Lesson', | ||
'Event' | ||
]; | ||
|
||
// Filter out the currently selected type from the available types | ||
const availableTypes = currentlySelected | ||
? resourceTypes.filter(type => type !== currentlySelected) | ||
: resourceTypes; | ||
|
||
// Select a random type from the available types | ||
return faker.helpers.arrayElement(availableTypes); | ||
}, | ||
}, | ||
|
||
// Data for export selection tests | ||
export: { | ||
style: 'Harvard', // Hardcoded style option for the test | ||
exportOption: 'JSON-LD' // Hardcoded export option for the test | ||
}, | ||
|
||
// Method to get today's date plus one day in YYYY-MM-DD format | ||
getDatePlusOne: (): string => { | ||
const today = new Date(); | ||
const tomorrow = new Date(today); | ||
tomorrow.setDate(today.getDate() + 1); | ||
|
||
// Format the date as YYYY-MM-DD | ||
const year = tomorrow.getFullYear(); | ||
const month = String(tomorrow.getMonth() + 1).padStart(2, '0'); // Months are 0-based | ||
const day = String(tomorrow.getDate()).padStart(2, '0'); | ||
|
||
return `${year}-${month}-${day}`; | ||
} | ||
}; |
Oops, something went wrong.