Skip to content

Commit

Permalink
#anotations
Browse files Browse the repository at this point in the history
  • Loading branch information
brablcp committed Oct 23, 2024
1 parent 35b8ff4 commit 674953f
Show file tree
Hide file tree
Showing 46 changed files with 2,728 additions and 63 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: npx playwright test
run: QASE_MODE=testops npx playwright test
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Install playwright browsers
run: npx playwright install --with-deps
- name: Run tests
run: npx playwright test
run: QASE_MODE=testops npx playwright test
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
Expand Down
27 changes: 27 additions & 0 deletions .history/.github/workflows/playwright_20241014104838.yml
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
27 changes: 27 additions & 0 deletions .history/.github/workflows/playwright_20241023144315.yml
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
34 changes: 34 additions & 0 deletions .history/.github/workflows/tests_20241023144354.yml
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
34 changes: 34 additions & 0 deletions .history/.github/workflows/tests_20241023144357.yml
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
81 changes: 81 additions & 0 deletions .history/data/testData_20241023130356.ts
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}`;
}
};
82 changes: 82 additions & 0 deletions .history/data/testData_20241023132112.ts
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}`;
}
};
82 changes: 82 additions & 0 deletions .history/data/testData_20241023132146.ts
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}`;
}
};
Loading

0 comments on commit 674953f

Please sign in to comment.