Skip to content

Commit

Permalink
chore: e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
rafasdc committed Dec 31, 2024
1 parent 9d99316 commit 011d72a
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/actions/local-app-run/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ runs:
./sqitch deploy
- name: start app
shell: bash
run: docker run -d --network=host -e "PGUSER=postgres" -e "ENABLE_MOCK_AUTH=true" -e "ENABLE_MOCK_COOKIES=true" -e "NEXT_PUBLIC_GROWTHBOOK_API_KEY=dev_MIjxKii1kycPLz7CSjBYui0uERkFRSn7AXbu6oROCRQ" -p 3000:3000 ghcr.io/bcgov/conn-ccbc-portal/ccbc-app:sha-${{ github.sha }}
run: docker run -d --network=host -e "PGUSER=postgres" -e "ENABLE_MOCK_AUTH=true" -e "ENABLE_MOCK_COOKIES=true" -e "NEXT_PUBLIC_GROWTHBOOK_API_KEY=dev_MIjxKii1kycPLz7CSjBYui0uERkFRSn7AXbu6oROCRQ" -p 3000:3000 ghcr.io/bcgov/conn-ccbc-portal/ccbc-app:sha-b01106033f12b23aa95bc986e7bec08d5fd0fe7a
2 changes: 1 addition & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
uses: ./.github/workflows/test-zap.yaml

test-e2e:
needs: [build, install-env]
needs: [install-env]
uses: ./.github/workflows/test-e2e.yaml
secrets:
HAPPO_API_KEY: ${{ secrets.HAPPO_API_KEY }}
Expand Down
62 changes: 50 additions & 12 deletions app/cypress/e2e/analyst/gis/upload.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ describe('GIS Upload', () => {
cy.contains(/GIS analysis updated for 0 projects/);
cy.contains(/Total processed 1/);
cy.get('body').happoScreenshot({ component: 'GIS upload success page' });
});

it('upload invalid json with invalid schema', () => {
cy.visit('/analyst/dashboard');
cy.contains('a', 'GIS').click();
cy.wait(10000);
cy.url().should('include', '/analyst/gis');
Expand All @@ -54,10 +50,6 @@ describe('GIS Upload', () => {
cy.contains(/Error uploading JSON file/);
cy.contains(/GIS_TOTAL_HH must be number/);
cy.contains(/GIS_PERCENT_OVERBUILD must be number/);
});

it('upload invalid json wrong format', () => {
cy.visit('/analyst/dashboard');
cy.contains('a', 'GIS').click();
cy.wait(10000);
cy.url().should('include', '/analyst/gis');
Expand All @@ -70,10 +62,6 @@ describe('GIS Upload', () => {
cy.wait(10000);
cy.contains(/Error uploading JSON file/);
cy.contains(/must be array at line 1/);
});

it('upload invalid json with empty values', () => {
cy.visit('/analyst/dashboard');
cy.contains('a', 'GIS').click();
cy.wait(10000);
cy.url().should('include', '/analyst/gis');
Expand All @@ -89,4 +77,54 @@ describe('GIS Upload', () => {
cy.contains(/Expected comma at line 5/);
cy.contains(/Value expected at line 10/);
});

// it('upload invalid json with invalid schema', () => {
// cy.visit('/analyst/dashboard');
// cy.contains('a', 'GIS').click();
// cy.wait(10000);
// cy.url().should('include', '/analyst/gis');
// cy.get('[data-testid=file-test]')
// .first()
// .selectFile('./tests/backend/lib/gis-data-errors.json', { force: true });
// cy.wait(10000);
// cy.contains('gis-data-errors.json');
// cy.contains('button', 'Continue').click();
// cy.contains(/Error uploading JSON file/);
// cy.contains(/GIS_TOTAL_HH must be number/);
// cy.contains(/GIS_PERCENT_OVERBUILD must be number/);
// });

// it('upload invalid json wrong format', () => {
// cy.visit('/analyst/dashboard');
// cy.contains('a', 'GIS').click();
// cy.wait(10000);
// cy.url().should('include', '/analyst/gis');
// cy.get('[data-testid=file-test]')
// .first()
// .selectFile('./tests/backend/lib/gis-data-400a.json', { force: true });
// cy.wait(10000);
// cy.contains('gis-data-400a.json');
// cy.contains('button', 'Continue').click();
// cy.wait(10000);
// cy.contains(/Error uploading JSON file/);
// cy.contains(/must be array at line 1/);
// });

// it('upload invalid json with empty values', () => {
// cy.visit('/analyst/dashboard');
// cy.contains('a', 'GIS').click();
// cy.wait(10000);
// cy.url().should('include', '/analyst/gis');
// cy.get('[data-testid=file-test]')
// .first()
// .selectFile('./tests/backend/lib/gis-data-400b.json', { force: true });
// cy.wait(10000);
// cy.contains('gis-data-400b.json');
// cy.contains('button', 'Continue').click();
// cy.wait(10000);
// cy.contains(/Error uploading JSON file/);
// cy.contains(/Value expected at line 2/);
// cy.contains(/Expected comma at line 5/);
// cy.contains(/Value expected at line 10/);
// });
});

0 comments on commit 011d72a

Please sign in to comment.