-
Notifications
You must be signed in to change notification settings - Fork 10
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
EREGCSC-2156 -- Refined policy repository results styling #955
Changes from all commits
d548a25
f155871
41a22d6
fbb79ba
c404f9b
f5bbca3
b9ad91c
11f1d44
6c314d6
63d9c48
c3110bf
2b38075
bc6db93
293586e
594fcf8
ab4f162
e6049b1
001b3ad
b8d14de
4a9567e
ced7752
65fe465
5293bdb
c7fc31b
2fbd133
d255d83
f0d63cb
4ab5769
f0a5251
0d8fb92
5088923
a243729
ae90986
fb29dab
26200eb
bcacc7f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -315,14 +315,29 @@ jobs: | |
[1]: ${{ env.django_url }} | ||
reactions: "+1" | ||
test-cypress: | ||
needs: [deploy-go, deploy-django, build-and-deploy-vue] | ||
environment: | ||
name: "dev" | ||
runs-on: ubuntu-20.04 | ||
needs: [deploy-go, deploy-django, build-and-deploy-vue] | ||
steps: | ||
# Checkout the code | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
# Configure AWS credentials for GitHub Actions | ||
- name: Configure AWS credentials for GitHub Actions | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
role-to-assume: ${{ secrets.AWS_OIDC_ROLE_TO_ASSUME }} | ||
aws-region: us-east-1 | ||
# Get test user credentials from AWS Parameter Store | ||
- name: Get test user credentials | ||
uses: dkershner6/aws-ssm-getparameters-action@v1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. AWS has not published any "official" actions for getting params from Parameter Store, but this action has the most stars of any I found and is currently maintained. |
||
with: | ||
parameterPairs: "/eregulations/http/user = CYPRESS_TEST_USERNAME, | ||
/eregulations/http/password = CYPRESS_TEST_PASSWORD" | ||
withDecryption: "true" # defaults to true | ||
# Setup node environment | ||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -153,6 +153,13 @@ jobs: | |
working-directory: ./solution/backend | ||
run: | | ||
pytest -vv | ||
# Get test user credentials from AWS Parameter Store | ||
- name: Get test user credentials | ||
uses: dkershner6/aws-ssm-getparameters-action@v1 | ||
with: | ||
parameterPairs: "/eregulations/http/test_user = CYPRESS_TEST_USERNAME, | ||
/eregulations/http/test_password = CYPRESS_TEST_PASSWORD" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. notice that this is using |
||
withDecryption: "true" # defaults to true | ||
- name: end-to-end tests | ||
uses: cypress-io/github-action@v5 | ||
with: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
{% extends "regulations/base.html" %} | ||
{% load static %} | ||
|
||
{% block footer %} | ||
<footer> | ||
{% include "regulations/partials/footer.html" with spa_footer=True %} | ||
</footer> | ||
{% endblock %} | ||
|
||
{% block post_footer %} | ||
<script src="{% static '/vite/index.js' %}?{{ DEPLOY_NUMBER }}"></script> | ||
{% endblock %} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"TEST_USERNAME": "Use this template to create your own local cypress.env.json file. Replace these values with a test username and test password that you have created locally using Django Admin.", | ||
"TEST_PASSWORD": "Once you save this file as cypress.env.json, it will be ignored by Github." | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
const TITLE_42 = 42; | ||
const TITLE_45 = 45; | ||
|
||
const username = Cypress.env("TEST_USERNAME"); | ||
const password = Cypress.env("TEST_PASSWORD"); | ||
|
||
describe("Policy Repository", () => { | ||
beforeEach(() => { | ||
cy.intercept("/**", (req) => { | ||
req.headers["x-automated-test"] = Cypress.env("DEPLOYING"); | ||
}); | ||
|
||
cy.intercept("**/v3/titles", [TITLE_42, TITLE_45]).as("titles"); | ||
|
||
cy.intercept(`**/v3/title/${TITLE_42}/parts`, { | ||
fixture: "parts-42.json", | ||
}).as("parts42"); | ||
|
||
cy.intercept(`**/v3/title/${TITLE_45}/parts`, { | ||
fixture: "parts-45.json", | ||
}).as("parts45"); | ||
}); | ||
|
||
it("shows the login screen when you visit /policy-repository/ without logging in", () => { | ||
cy.viewport("macbook-15"); | ||
cy.visit("/policy-repository/"); | ||
cy.url().should("include", "/admin/login"); | ||
}); | ||
|
||
it("show the policy repository page when logged in", () => { | ||
cy.viewport("macbook-15"); | ||
cy.eregsLogin({ username, password }); | ||
cy.visit("/policy-repository"); | ||
cy.url().should("include", "/policy-repository/"); | ||
cy.get("#loginIndicator").should("be.visible"); | ||
}); | ||
|
||
it("returns you to the admin login page when you log out", () => { | ||
cy.viewport("macbook-15"); | ||
cy.eregsLogin({ username, password }); | ||
cy.visit("/policy-repository"); | ||
cy.get("#logout").click(); | ||
cy.get("#login-form").should("be.visible"); | ||
}); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
[ | ||
{ | ||
"id": 104, | ||
"name": "400", | ||
"date": "2023-01-01", | ||
"last_updated": "2023-09-06 09:52:04.760846", | ||
"depth": 3 | ||
}, | ||
{ | ||
"id": 5, | ||
"name": "430", | ||
"date": "2017-01-20", | ||
"last_updated": "2023-09-06 09:47:03.292501", | ||
"depth": 3 | ||
}, | ||
{ | ||
"id": 32, | ||
"name": "431", | ||
"date": "2023-01-01", | ||
"last_updated": "2023-09-11 09:03:59.358576", | ||
"depth": 3 | ||
}, | ||
{ | ||
"id": 6, | ||
"name": "432", | ||
"date": "2020-06-30", | ||
"last_updated": "2023-09-11 09:02:54.341007", | ||
"depth": 3 | ||
}, | ||
{ | ||
"id": 20, | ||
"name": "433", | ||
"date": "2023-08-31", | ||
"last_updated": "2023-09-06 09:47:43.850806", | ||
"depth": 3 | ||
}, | ||
{ | ||
"id": 9, | ||
"name": "434", | ||
"date": "2017-01-01", | ||
"last_updated": "2023-09-11 09:02:56.476197", | ||
"depth": 3 | ||
}, | ||
{ | ||
"id": 35, | ||
"name": "435", | ||
"date": "2023-01-01", | ||
"last_updated": "2023-09-11 09:03:28.146819", | ||
"depth": 3 | ||
}, | ||
{ | ||
"id": 22, | ||
"name": "436", | ||
"date": "2017-01-01", | ||
"last_updated": "2023-09-11 09:03:14.240732", | ||
"depth": 3 | ||
}, | ||
{ | ||
"id": 80, | ||
"name": "438", | ||
"date": "2021-07-01", | ||
"last_updated": "2023-09-06 09:51:07.897257", | ||
"depth": 3 | ||
}, | ||
{ | ||
"id": 56, | ||
"name": "440", | ||
"date": "2020-12-16", | ||
"last_updated": "2023-09-11 09:04:12.992711", | ||
"depth": 3 | ||
}, | ||
{ | ||
"id": 64, | ||
"name": "441", | ||
"date": "2023-08-04", | ||
"last_updated": "2023-09-06 09:50:21.768508", | ||
"depth": 3 | ||
}, | ||
{ | ||
"id": 59, | ||
"name": "442", | ||
"date": "2017-01-01", | ||
"last_updated": "2023-09-11 09:04:17.312061", | ||
"depth": 3 | ||
}, | ||
{ | ||
"id": 121, | ||
"name": "447", | ||
"date": "2023-01-01", | ||
"last_updated": "2023-09-11 09:04:54.703021", | ||
"depth": 3 | ||
}, | ||
{ | ||
"id": 95, | ||
"name": "455", | ||
"date": "2023-01-01", | ||
"last_updated": "2023-09-11 09:04:45.057080", | ||
"depth": 3 | ||
}, | ||
{ | ||
"id": 92, | ||
"name": "456", | ||
"date": "2021-03-01", | ||
"last_updated": "2023-09-11 09:05:08.592712", | ||
"depth": 3 | ||
}, | ||
{ | ||
"id": 135, | ||
"name": "457", | ||
"date": "2023-08-31", | ||
"last_updated": "2023-09-11 09:05:59.349077", | ||
"depth": 3 | ||
}, | ||
{ | ||
"id": 142, | ||
"name": "460", | ||
"date": "2023-08-04", | ||
"last_updated": "2023-09-11 09:05:40.860734", | ||
"depth": 3 | ||
} | ||
] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[ | ||
{ | ||
"id": 146, | ||
"name": "95", | ||
"date": "2019-11-05", | ||
"last_updated": "2023-09-06 09:54:50.168999", | ||
"depth": 3 | ||
}, | ||
{ | ||
"id": 183, | ||
"name": "155", | ||
"date": "2023-06-18", | ||
"last_updated": "2023-09-06 09:58:34.319879", | ||
"depth": 3 | ||
} | ||
] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// login via policy repository page for now | ||
export const eregsLogin = ({ username, password }) => { | ||
cy.session([username, password], () => { | ||
cy.visit("/policy-repository/"); | ||
cy.get("#id_username").type(username); | ||
cy.get("#id_password").type(password); | ||
cy.get("#login-form").submit(); | ||
}); | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ | |
}, | ||
"plugins": ["vue"], | ||
"rules": { | ||
"no-console": ["error", { "allow": ["warn", "error"] }], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. allow console warns and console errors without ESLint getting mad at you |
||
"vue/order-in-components": "off", | ||
"vue/no-unsupported-features": [ | ||
"error", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uses recently released v4 of this action