-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from camptocamp/e2e
Set up e2e tests
- Loading branch information
Showing
9 changed files
with
133 additions
and
27 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
name: CI | ||
|
||
env: | ||
NODE_VERSION: 18.16.1 | ||
|
||
on: | ||
push: | ||
branches: | ||
|
@@ -27,6 +30,32 @@ jobs: | |
npx nx affected --target=test --parallel=3 --ci --code-coverage | ||
npx nx affected --target=build --parallel=3 | ||
cypress-run: | ||
name: End-to-end tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Use Node.js ${{ env.NODE_VERSION }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
cache: 'npm' | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: geonetwork/geonetwork-ui | ||
path: './geonetwork-ui' | ||
- name: Build the gn-ui backend | ||
run: sudo docker-compose -f geonetwork-ui/support-services/docker-compose.yml up -d init | ||
|
||
- name: Install dependencies | ||
run: npm i | ||
|
||
- name: Run tests | ||
run: npx nx e2e mel-datahub-e2e | ||
|
||
agents: | ||
name: Nx Cloud - Agents | ||
uses: nrwl/ci/.github/workflows/[email protected] | ||
|
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,11 @@ | ||
describe('datahub-e2e', () => { | ||
beforeEach(() => cy.visit('/home')) | ||
|
||
it('should display the title', () => { | ||
cy.get('.mel-page-title').should('be.visible') | ||
}) | ||
it('should display the search bar and placeholder', () => { | ||
cy.get('gn-ui-fuzzy-search').should('be.visible') | ||
cy.get('gn-ui-autocomplete').should('have.length.gt', 0) | ||
}) | ||
}) |
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 @@ | ||
describe('datahub-e2e', () => { | ||
beforeEach(() => cy.visit('/search')) | ||
|
||
it('should display the title', () => { | ||
cy.get('.mel-page-title').should('be.visible') | ||
}) | ||
it('should display the number of result hits', () => { | ||
cy.get('gn-ui-results-hits-number').should('contain', 12) | ||
}) | ||
it('should display record results in preview cards', () => { | ||
cy.get('mel-datahub-results-list-grid') | ||
.find('mel-datahub-results-card-search') | ||
.eq(0) | ||
.find('h1') | ||
.should( | ||
'have.text', | ||
' Cartographie des sols agricoles de la plaine du Rhône ' | ||
) | ||
}) | ||
}) |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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