Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test/adds archive cataloguings workflow test #460

Open
wants to merge 77 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
1cf8c79
chore: removes sample spec
andrea-kyurchiev Aug 12, 2024
c26d739
fix: retuns false on uncaught exepction
andrea-kyurchiev Aug 12, 2024
bf265a7
wip: feat: adds flag for enforcement workflow test
andrea-kyurchiev Aug 12, 2024
b8a6e3a
wip: feat: selects first option in dropdown
andrea-kyurchiev Aug 12, 2024
d33cbca
refactor: changes double quotes to single quotes
andrea-kyurchiev Aug 14, 2024
057485f
feat: adds a cypress command that allows editing rich textboxes
andrea-kyurchiev Aug 14, 2024
22eca49
test: adds to the ffe workflow
andrea-kyurchiev Aug 14, 2024
13299f9
chore: adds cypress gitignore
andrea-kyurchiev Aug 14, 2024
b17da75
test: check all populated fields and go through workflow with just id
andrea-kyurchiev Aug 15, 2024
2856162
test: adds test with only case reference
andrea-kyurchiev Aug 15, 2024
e87df40
test: adds tests for each field
andrea-kyurchiev Aug 15, 2024
4ebb362
test: fix flagged date selection
andrea-kyurchiev Aug 15, 2024
2f17e4b
test: removes unnecessary next redirect
andrea-kyurchiev Aug 15, 2024
00620aa
chore: removes sample spec
andrea-kyurchiev Aug 12, 2024
4a1a7f5
fix: retuns false on uncaught exepction
andrea-kyurchiev Aug 12, 2024
c168802
wip: feat: adds flag for enforcement workflow test
andrea-kyurchiev Aug 12, 2024
839def5
wip: feat: selects first option in dropdown
andrea-kyurchiev Aug 12, 2024
e4387c3
refactor: changes double quotes to single quotes
andrea-kyurchiev Aug 14, 2024
0b13911
feat: adds a cypress command that allows editing rich textboxes
andrea-kyurchiev Aug 14, 2024
7040fb6
test: adds to the ffe workflow
andrea-kyurchiev Aug 14, 2024
dfad8f7
chore: adds cypress gitignore
andrea-kyurchiev Aug 14, 2024
89be197
test: check all populated fields and go through workflow with just id
andrea-kyurchiev Aug 15, 2024
a057b03
test: adds test with only case reference
andrea-kyurchiev Aug 15, 2024
88afd82
test: adds tests for each field
andrea-kyurchiev Aug 15, 2024
9e969a1
test: fix flagged date selection
andrea-kyurchiev Aug 15, 2024
77f8667
test: removes unnecessary next redirect
andrea-kyurchiev Aug 15, 2024
fdbfcb7
chore: removes spaces
andrea-kyurchiev Aug 15, 2024
cc24d1b
test: creates person to be used in tests
andrea-kyurchiev Aug 19, 2024
75a2021
Merge branch 'feature/cypress-tests' of https://github.com/flaxandtea…
andrea-kyurchiev Aug 19, 2024
a15b657
test: delete test since its been renamed
andrea-kyurchiev Aug 19, 2024
5d594f2
test: adds create heritage asset test
andrea-kyurchiev Aug 19, 2024
0e9a9a5
test: adds commented search for the created person
andrea-kyurchiev Aug 19, 2024
39f0788
ops: uncomment the test step
andrea-kyurchiev Aug 19, 2024
191a39c
test: add temporary solution that selects Test Person
andrea-kyurchiev Aug 19, 2024
ad045a8
test: adds create organisation test
andrea-kyurchiev Aug 19, 2024
96e625d
test: search properly for test person
andrea-kyurchiev Aug 19, 2024
2852e16
test: lower waits
andrea-kyurchiev Aug 19, 2024
0d217dd
ops: comment out test step since it doesnt work
andrea-kyurchiev Aug 20, 2024
c23ba1d
test: select the created heritage asset
andrea-kyurchiev Aug 20, 2024
d1f5860
test: tests with multiple people as well as organisation
andrea-kyurchiev Aug 20, 2024
c2ed701
test: enables cypress studio
andrea-kyurchiev Aug 20, 2024
9d6c2e3
test: complete the first tab of the archiving workflow
andrea-kyurchiev Aug 20, 2024
fd6a980
test: full workflow test
andrea-kyurchiev Aug 21, 2024
1a2b755
ci: restore tests running in the ci
taylorn01 Aug 29, 2024
ee589a5
fix: uses baseUrl to fix the run in CI
andrea-kyurchiev Aug 30, 2024
0369610
fix: create heritage asset from workflow instead
andrea-kyurchiev Sep 3, 2024
fdbe737
fix: add static url and static root
andrea-kyurchiev Sep 3, 2024
1a79d26
fix: add arches root param
andrea-kyurchiev Sep 4, 2024
d2ee9ce
fix: update cypress action version
andrea-kyurchiev Sep 4, 2024
59eeab7
fix: try disabling coral package install
andrea-kyurchiev Sep 5, 2024
5d4b5f7
fix: add steps from static build
andrea-kyurchiev Sep 9, 2024
cac114a
fix: try with only build and push
andrea-kyurchiev Sep 12, 2024
d4f919a
fix: remove build step
andrea-kyurchiev Sep 17, 2024
87cccae
fix: comment out extract metadata step
andrea-kyurchiev Sep 18, 2024
f2fa3be
fix: change the image name in case its case sensitive
andrea-kyurchiev Sep 18, 2024
8d3cce1
fix: revert back to previous commit
andrea-kyurchiev Sep 18, 2024
4ab881f
tests: brings tests to match the latest test sheet description
andrea-kyurchiev Sep 18, 2024
0a68b83
Merge branch 'feature/adds-flag-for-enforcement-cypress-test' into te…
andrea-kyurchiev Sep 19, 2024
adcccd3
Merge branch 'dev' into test/adds-archive-cataloguings-workflow-test
andrea-kyurchiev Sep 19, 2024
1b2aaf0
test: adds to the full workflow test
andrea-kyurchiev Sep 19, 2024
7f935cd
test: dates values should remain after adding
andrea-kyurchiev Sep 19, 2024
8ad0a0c
Merge branch 'dev' into test/adds-archive-cataloguings-workflow-test
andrea-kyurchiev Sep 19, 2024
12e5955
test: adjusts test for new version
andrea-kyurchiev Sep 19, 2024
ce7b465
test: update tests to work accordingly with latest version
andrea-kyurchiev Sep 19, 2024
777d317
Merge branch 'feature/adds-flag-for-enforcement-cypress-test' into te…
andrea-kyurchiev Sep 19, 2024
3d0db3a
test: open a created archive and verify the information
andrea-kyurchiev Sep 19, 2024
43ba632
test: adds Archive Source Details individual field tests
andrea-kyurchiev Sep 20, 2024
f7e662e
test: remove unnecessary step
andrea-kyurchiev Sep 20, 2024
91e2893
test: fix non working tests
andrea-kyurchiev Sep 20, 2024
92a0f5b
test: adds Archive Source Creation tab individual tests
andrea-kyurchiev Sep 20, 2024
ca2ead6
tests: adds Repository Storage Location individual tests
andrea-kyurchiev Sep 20, 2024
f556df6
test: adds Archive Loan History individual field tests
andrea-kyurchiev Sep 20, 2024
148fceb
Merge branch 'dev' into feature/adds-flag-for-enforcement-cypress-test
andrea-kyurchiev Sep 24, 2024
a51fa42
Merge branch 'dev' into test/adds-archive-cataloguings-workflow-test
andrea-kyurchiev Sep 24, 2024
70841c1
test: increase waits for breaking tests
andrea-kyurchiev Sep 25, 2024
5bc24d7
test: increase waits
andrea-kyurchiev Sep 25, 2024
408a884
Merge branch 'feature/adds-flag-for-enforcement-cypress-test' into te…
andrea-kyurchiev Sep 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
212 changes: 108 additions & 104 deletions .github/workflows/project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -268,109 +268,113 @@ jobs:
run: |
name=${{ fromJSON(steps.buildx.outputs.metadata)['image.name'] }}
echo "image_name=$name" | sed 's/,.*//g' >> $GITHUB_OUTPUT
# Test-Arches:
# runs-on: [self-hosted]
# needs: [Build-Arches-Final]
# container:
# image: cypress/included:12.3.0
# env:
# HOME: ""
# DEBUG: "cypress:*"
# CYPRESS_BASE_URL: http://arches:8000
# steps:
# - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
# - name: Check out repository code
# uses: actions/checkout@v3
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# submodules: 'true'
# - name: Cypress run
# uses: cypress-io/github-action@v4
# with:
# browser: firefox
# install: false
# wait-on: 'http://arches:8000'
# wait-on-timeout: 6000
# - uses: actions/upload-artifact@v3
# if: failure()
# with:
# name: cypress-screenshots
# path: cypress/screenshots
# - uses: actions/upload-artifact@v3
# if: always()
# with:
# name: cypress-videos
# path: cypress/videos
# services:
# elasticsearch:
# image: elasticsearch:8.4.0
# ports:
# - "9200:9200"
# - "9300:9300"
# env:
# TZ: "PST"
# discovery.type: "single-node"
# discovery.seed_hosts: "[]"
# xpack.security.enabled: "false"
# ES_JAVA_OPTS: "-Xms400m -Xmx400m"
# options: >-
# --health-cmd "curl -s --fail http://localhost:9200/_cat/health || exit 1"
# --health-interval 10s
# --health-timeout 5s
# --health-retries 10
Test-Arches:
runs-on: [self-hosted]
needs: [Build-Arches-Final]
container:
image: cypress/included:12.3.0
env:
HOME: ""
DEBUG: "cypress:*"
CYPRESS_BASE_URL: http://arches:8000
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- name: Check out repository code
uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
submodules: 'true'
- name: Cypress run
uses: cypress-io/github-action@v6
with:
browser: firefox
install: false
wait-on: 'http://arches:8000'
wait-on-timeout: 6000
- uses: actions/upload-artifact@v3
if: failure()
with:
name: cypress-screenshots
path: cypress/screenshots
- uses: actions/upload-artifact@v3
if: always()
with:
name: cypress-videos
path: cypress/videos
services:
elasticsearch:
image: elasticsearch:8.4.0
ports:
- "9200:9200"
- "9300:9300"
env:
TZ: "PST"
discovery.type: "single-node"
discovery.seed_hosts: "[]"
xpack.security.enabled: "false"
ES_JAVA_OPTS: "-Xms400m -Xmx400m"
options: >-
--health-cmd "curl -s --fail http://localhost:9200/_cat/health || exit 1"
--health-interval 10s
--health-timeout 5s
--health-retries 10

# db:
# image: flaxandteal/arches_coral_postgres
# #volumes:
# # - ${{ github.workspace }}/scripts/init-unix.sql:/docker-entrypoint-initdb.d/init.sql # to set up the DB template
# ports:
# - '5432:5432'
# env:
# POSTGRES_USER: postgres
# POSTGRES_PASS: postgres
# POSTGRES_DB: postgres
# POSTGRES_MULTIPLE_EXTENSIONS: postgis,postgis_topology
# TZ: PST
# options: >-
# --health-cmd "pg_isready -h 127.0.0.1 -U postgres -d postgres"
# --health-interval 10s
# --health-timeout 5s
# --health-retries 20
db:
image: flaxandteal/arches_coral_postgres
#volumes:
# - ${{ github.workspace }}/scripts/init-unix.sql:/docker-entrypoint-initdb.d/init.sql # to set up the DB template
ports:
- '5432:5432'
env:
POSTGRES_USER: postgres
POSTGRES_PASS: postgres
POSTGRES_DB: postgres
POSTGRES_MULTIPLE_EXTENSIONS: postgis,postgis_topology
TZ: PST
options: >-
--health-cmd "pg_isready -h 127.0.0.1 -U postgres -d postgres"
--health-interval 10s
--health-timeout 5s
--health-retries 20

# arches:
# image: "${{ needs['Build-Arches-Final'].outputs.image }}"
# env:
# ALLOW_BOOTSTRAP: "True"
# ARCHES_PROJECT: "${{ env.ARCHES_PROJECT }}"
# COMPRESS_OFFLINE: "False"
# INSTALL_CORAL_PACKAGE: "True"
# INSTALL_DEFAULT_GRAPHS: "False"
# INSTALL_DEFAULT_CONCEPTS: "False"
# PGUSERNAME: "postgres"
# PGPASSWORD: "postgres"
# PGDBNAME: "arches"
# PGHOST: "db"
# PGPORT: "5432"
# RABBITMQ_USER: "rabbitmq"
# RABBITMQ_PASS: "rabbitmq"
# CANTALOUPE_HOST: "cantaloupe"
# CANTALOUPE_PORT: "8182"
# COUCHDB_HOST: "couchdb"
# COUCHDB_PORT: "5984"
# COUCHDB_USER: "admin"
# COUCHDB_PASS: "password"
# ESHOST: "elasticsearch"
# ESPORT: "9200"
# CELERY_BROKER_URL: "amqp://rabbitmq"
# DJANGO_MODE: "PROD"
# DJANGO_DEBUG: "False"
# DOMAIN_NAMES: "arches"
# PYTHONUNBUFFERED: "0"
# TZ: "PST"
# ports:
# - '8000:8000'
# options: >-
# --health-cmd "curl --fail http://localhost:8000/templates/views/components/language-switcher.htm || exit 1"
# --health-interval 10s
# --health-timeout 5s
# --health-retries 1000
arches:
image: "${{ needs['Build-Arches-Final'].outputs.image }}"
env:
ALLOW_BOOTSTRAP: "True"
ARCHES_PROJECT: "${{ env.ARCHES_PROJECT }}"
COMPRESS_OFFLINE: "False"
INSTALL_CORAL_PACKAGE: "False"
INSTALL_DEFAULT_GRAPHS: "False"
INSTALL_DEFAULT_CONCEPTS: "False"
PGUSERNAME: "postgres"
PGPASSWORD: "postgres"
PGDBNAME: "arches"
PGHOST: "db"
PGPORT: "5432"
RABBITMQ_USER: "rabbitmq"
RABBITMQ_PASS: "rabbitmq"
CANTALOUPE_HOST: "cantaloupe"
CANTALOUPE_PORT: "8182"
COUCHDB_HOST: "couchdb"
COUCHDB_PORT: "5984"
COUCHDB_USER: "admin"
COUCHDB_PASS: "password"
ESHOST: "elasticsearch"
ESPORT: "9200"
CELERY_BROKER_URL: "amqp://rabbitmq"
DJANGO_MODE: "PROD"
DJANGO_DEBUG: "False"
DOMAIN_NAMES: "arches"
PYTHONUNBUFFERED: "0"
STATIC_URL: "/static/"
STATIC_ROOT: "/static_root"
WEB_ROOT: "/web_root"
ARCHES_ROOT: "/web_root/arches"
TZ: "PST"
ports:
- '8000:8000'
options: >-
--health-cmd "curl --fail http://localhost:8000/templates/views/components/language-switcher.htm || exit 1"
--health-interval 10s
--health-timeout 5s
--health-retries 1000
2 changes: 2 additions & 0 deletions cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ module.exports = {
projectId: 'arches',
video: true,
e2e: {
baseUrl: "http://localhost:8000",
setupNodeEvents(on, config) {},
specPattern: 'cypress/e2e/**/*.{js,jsx,ts,tsx}',
experimentalStudio: true,
},
}
2 changes: 2 additions & 0 deletions cypress/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/videos
/screenshots
49 changes: 49 additions & 0 deletions cypress/e2e/01_create_a_person.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
describe('Creating a person named Test Person and a person named John Doe if they dont exist', function () {
beforeEach(() => {
cy.login();
});

it('Create a person', function () {
cy.visit('/search?paging-filter=1&tiles=true&format=tilecsv&reportlink=false&precision=6&total=125&language=*&term-filter=%5B%7B%22context%22%3A%22%22%2C%22context_label%22%3A%22Person%20-%20Name%22%2C%22id%22%3A%22termTest%20PersonPerson%20-%20Name%22%2C%22text%22%3A%22Test%20Person%22%2C%22type%22%3A%22term%22%2C%22value%22%3A%22Test%20Person%22%2C%22inverted%22%3Afalse%2C%22selected%22%3Atrue%7D%5D');
cy.wait(5000).then(() => {
cy.get('#search-results-list').then(($el) => {
if ($el.find('.search-listing').length > 0) {
// A caveat to this is that it will only look at the first page (which shouldn't be a problem with a fresh instance) since the search was failing locally to find Test Person (probably a permissions issue as all objects were created as Provisional)
if (!$el.text().includes('Test Person')) {
cy.visit('/add-resource/22477f01-1a44-11e9-b0a9-000d3ab1e588')
cy.contains('Names').click();
cy.get('[aria-label="Full Name"]').should('be.visible').type('Test Person');
cy.get('button').contains('Add').click();
}
} else {
cy.visit('/add-resource/22477f01-1a44-11e9-b0a9-000d3ab1e588')
cy.contains('Names').click();
cy.get('[aria-label="Full Name"]').should('be.visible').type('Test Person');
cy.get('button').contains('Add').click();
}
})
});
});

it('Create a second person', function () {
cy.visit('/search?paging-filter=1&tiles=true&format=tilecsv&reportlink=false&precision=6&total=329&term-filter=%5B%7B%22context%22%3A%22%22%2C%22context_label%22%3A%22Person%20-%20Name%22%2C%22id%22%3A%22termJohn%20DoePerson%20-%20Name%22%2C%22text%22%3A%22John%20Doe%22%2C%22type%22%3A%22term%22%2C%22value%22%3A%22John%20Doe%22%2C%22inverted%22%3Afalse%2C%22selected%22%3Atrue%7D%5D&language=*');
cy.wait(5000).then(() => {
cy.get('#search-results-list').then(($el) => {
if ($el.find('.search-listing').length > 0) {
// A caveat to this is that it will only look at the first page (which shouldn't be a problem with a fresh instance) since the search was failing locally to find John Doe (probably a permissions issue as all objects were created as Provisional)
if (!$el.text().includes('John Doe')) {
cy.visit('/add-resource/22477f01-1a44-11e9-b0a9-000d3ab1e588')
cy.contains('Names').click();
cy.get('[aria-label="Full Name"]').should('be.visible').type('John Doe');
cy.get('button').contains('Add').click();
}
} else {
cy.visit('/add-resource/22477f01-1a44-11e9-b0a9-000d3ab1e588')
cy.contains('Names').click();
cy.get('[aria-label="Full Name"]').should('be.visible').type('John Doe');
cy.get('button').contains('Add').click();
}
})
});
});
});
Loading
Loading