diff --git a/doc/how-to/how-to-setup-aws-sso-credentials.md b/doc/how-to/how-to-setup-aws-sso-credentials.md index 7cf3aae254..6d01566b64 100644 --- a/doc/how-to/how-to-setup-aws-sso-credentials.md +++ b/doc/how-to/how-to-setup-aws-sso-credentials.md @@ -4,9 +4,15 @@ This document describes the process of setting up credentials for your local AWS ## Process As part of onboarding, you should be set up to access AWS via [the SSO portal](https://opensystemslab.awsapps.com/start#/). Please ensure that you have set up and enabled MFA. -1. Download the AWS CLI -1. Run `aws configure sso` - the required details can be found via the SSO portal -1. For the "profile" field please use the format `planx-`, e.g. `planx-staging` +1. Download the AWS CLI - see https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html +1. Run `aws configure sso` - some of the required details can be found via [the SSO portal](https://opensystemslab.awsapps.com/start#/) in the 'Access keys' section: + - e.g. `SSO start URL` and `SSO Region` are listed under `AWS IAM Identity Center credentials (Recommended)`. + - `SSO registration scopes` can be left as the default (`sso:account:access`). +1. Allow access from the authorisation page that should open in your browser. +1. You should be prompted for more details in the terminal: + - `CLI default client region` should be `eu-west-2` + - `CLI default output format` should be `json` + - For the `CLI profile name` field, please use the format `planx-`, e.g. `planx-staging` 1. Repeat for all environments (staging, production) 1. Test! You should be able to call commands using the CLI, for example `aws sts get-caller-identity --profile planx-staging` and get the expected result. diff --git a/e2e/tests/ui-driven/src/create-flow-with-geospatial.spec.ts b/e2e/tests/ui-driven/src/create-flow-with-geospatial.spec.ts index a5aa95f5b9..691f83a257 100644 --- a/e2e/tests/ui-driven/src/create-flow-with-geospatial.spec.ts +++ b/e2e/tests/ui-driven/src/create-flow-with-geospatial.spec.ts @@ -48,6 +48,11 @@ test.describe("Flow creation, publish and preview", () => { context.flow = { ...serviceProps }; await editor.createFindProperty(); + await expect(editor.nodeList).toContainText(["Find property"]); + await editor.createInternalPortal(); + await editor.populateInternalPortal(); + await page.getByRole("link", { name: "start" }).click(); // return to main flow + await editor.createFilter(); await editor.createUploadAndLabel(); // TODO: editor.createPropertyInfo() await editor.createDrawBoundary(); @@ -56,6 +61,8 @@ test.describe("Flow creation, publish and preview", () => { await expect(editor.nodeList).toContainText([ "Find property", + "an internal portalEdit Portal", + "(Flags Filter)ImmuneMissing informationPermission neededPrior approvalNoticePermitted developmentNot development(No Result)", "Upload and label", "Confirm your location plan", "Planning constraints", @@ -106,6 +113,13 @@ test.describe("Flow creation, publish and preview", () => { ).toBeVisible(); await answerFindProperty(page); await clickContinue({ page }); + + await expect( + page.locator("h1", { hasText: "A notice inside a portal!" }), + ).toBeVisible(); + await clickContinue({ page }); + + // TODO: answer filter? // TODO: answer uploadAndLabel // TODO: answerPropertyInfo, answerDrawBoundary, answerPlanningConstraints }); diff --git a/e2e/tests/ui-driven/src/create-flow.spec.ts b/e2e/tests/ui-driven/src/create-flow.spec.ts index f9b92265b9..8a17b5deb9 100644 --- a/e2e/tests/ui-driven/src/create-flow.spec.ts +++ b/e2e/tests/ui-driven/src/create-flow.spec.ts @@ -9,6 +9,7 @@ import { getTeamPage } from "./helpers/getPage"; import { createAuthenticatedSession } from "./helpers/globalHelpers"; import { answerAddressInput, + answerChecklist, answerContactInput, answerDateInput, answerListInput, @@ -59,7 +60,7 @@ test.describe("Flow creation, publish and preview", () => { await editor.createQuestion(); await editor.createNoticeOnEachBranch(); - // await editor.createChecklist(); + await editor.createChecklist(); await editor.createTextInput(); await editor.createNumberInput(); await editor.createDateInput(); @@ -68,6 +69,7 @@ test.describe("Flow creation, publish and preview", () => { await editor.createList(); await editor.createTaskList(); await editor.createContent(); + await editor.createResult(); await editor.createNextSteps(); await editor.createReview(); @@ -77,7 +79,7 @@ test.describe("Flow creation, publish and preview", () => { "Is this a test?", "Yes! this is a test", "Sorry, this is a test", - // "Checklist item 1", + "Checklist item 1", "Tell us about your trees.", "How old are you?", "When is your birthday?", @@ -202,12 +204,12 @@ test.describe("Flow creation, publish and preview", () => { ).toBeVisible(); await clickContinue({ page }); - // await answerChecklist({ - // page, - // title: "A checklist title", - // answers: ["Checklist item 1", "Second checklist item"], - // }); - // await clickContinue({ page }); + await answerChecklist({ + page, + title: "A checklist title", + answers: ["Checklist item 1", "Second checklist item"], + }); + await clickContinue({ page }); await answerTextInput(page, { expectedQuestion: "Tell us about your trees.", diff --git a/e2e/tests/ui-driven/src/helpers/addComponent.ts b/e2e/tests/ui-driven/src/helpers/addComponent.ts index 61cbec97de..9b41eacf4e 100644 --- a/e2e/tests/ui-driven/src/helpers/addComponent.ts +++ b/e2e/tests/ui-driven/src/helpers/addComponent.ts @@ -112,7 +112,11 @@ const createBaseComponent = async ( await page .locator("p[data-placeholder='Content']") .fill(options?.[0] || ""); - + break; + case ComponentType.Filter: + break; + case ComponentType.InternalPortal: + await page.getByPlaceholder("Portal name").fill(title || ""); break; default: throw new Error(`Unsupported type: ${type}`); @@ -365,3 +369,20 @@ export const createContent = async ( [content], ); }; + +export const createFilter = async (page: Page, locatingNode: Locator) => { + await createBaseComponent(page, locatingNode, ComponentType.Filter); +}; + +export const createInternalPortal = async ( + page: Page, + locatingNode: Locator, + portalName: string, +) => { + await createBaseComponent( + page, + locatingNode, + ComponentType.InternalPortal, + portalName, + ); +}; diff --git a/e2e/tests/ui-driven/src/pages/Editor.ts b/e2e/tests/ui-driven/src/pages/Editor.ts index 9891e8b1d6..eeda650d88 100644 --- a/e2e/tests/ui-driven/src/pages/Editor.ts +++ b/e2e/tests/ui-driven/src/pages/Editor.ts @@ -1,3 +1,5 @@ +import { ComponentType } from "@opensystemslab/planx-core/types"; + import { expect, type Locator, type Page } from "@playwright/test"; import { createAddressInput, @@ -8,7 +10,9 @@ import { createDateInput, createDrawBoundary, createFileUpload, + createFilter, createFindProperty, + createInternalPortal, createList, createNextSteps, createNotice, @@ -44,6 +48,7 @@ export class PlaywrightEditor { this.yesBranch = page.locator("#flow .card .options .option").nth(0); this.noBranch = page.locator("#flow .card .options .option").nth(1); this.nodeList = page.locator(".card"); + this.answers = { questionText: "Is this a test?", yesBranchNoticeText: "Yes! this is a test", @@ -205,4 +210,34 @@ export class PlaywrightEditor { async createContent() { await createContent(this.page, this.getNextNode(), "Some content"); } + + async createFilter() { + await createFilter(this.page, this.getNextNode()); + } + + async createInternalPortal() { + await createInternalPortal( + this.page, + this.getNextNode(), + "an internal portal", + ); + } + + async populateInternalPortal() { + const internalPortalButton = this.page.getByRole("link", { + name: "an internal portal", + }); + await internalPortalButton.click(); + + // create a notice inside the portal + await this.page.locator(".hanger > a").last().click(); + await this.page.getByRole("dialog").waitFor(); + await this.page + .locator("select") + .selectOption({ value: ComponentType.Notice.toString() }); + await this.page + .getByPlaceholder("Notice") + .fill("A notice inside a portal!"); + await this.page.locator('button[form="modal"][type="submit"]').click(); + } }