-
Notifications
You must be signed in to change notification settings - Fork 2
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
NO-REF: Fixing docker file and playwright tests #547
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
2800cc2
NO-REF: Fixing docker deploy
kylevillegas93 84c7e1a
updating change log
kylevillegas93 7713ffb
Fixing tests
kylevillegas93 6991e3b
trying to fix build
kylevillegas93 1f1b1a0
let us see
kylevillegas93 7bcd36b
fixing tests
kylevillegas93 61f602a
last little bits
kylevillegas93 4a23590
fixing text
kylevillegas93 acd4b0a
removing playwright tests for now
kylevillegas93 f50ec53
updating changelog
kylevillegas93 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,4 +1,4 @@ | ||
APP_ENV=testing | ||
APP_ENV=development | ||
|
||
# API ENDPOINT | ||
API_URL=https://backend.msw | ||
API_URL=https://drb-api-qa.nypl.org/ |
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,7 +1,8 @@ | ||
name: Playwright Tests for Digital Research Books | ||
|
||
on: | ||
pull_request: | ||
# TODO: Remove https://drb-api-qa.nypl.org from behind the VPC | ||
# on: | ||
# pull_request: | ||
|
||
jobs: | ||
tests: | ||
|
@@ -15,18 +16,35 @@ jobs: | |
with: | ||
node-version-file: ".nvmrc" | ||
|
||
- name: Install Deps | ||
- name: Install Test Dependencies | ||
run: npm i @cucumber/[email protected] @playwright/[email protected] | ||
|
||
- name: Install Playwright | ||
run: npx playwright install --with-deps | ||
|
||
- name: Build app | ||
run: NODE_ENV=test npm run build | ||
|
||
- name: Start the app | ||
run: npm run dev & | ||
shell: bash | ||
|
||
- name: Wait for the app | ||
run: | | ||
RETRIES=6 | ||
until curl --output /dev/null --silent --head --fail http://localhost:3000 || [ $((RETRIES--)) -eq 0 ]; do | ||
echo "Waiting for http://localhost:3000" | ||
sleep 5 | ||
done | ||
if [ $RETRIES -lt 0 ]; then | ||
echo "Failed to connect to http://localhost:3000" | ||
exit 1 | ||
fi | ||
shell: bash | ||
|
||
- name: Run your tests | ||
run: npm run playwright | ||
|
||
- name: Install Playwright Browser Utils | ||
run: npx playwright install --with-deps | ||
|
||
- name: Set the world parameters as an env var | ||
# WORLD_PARAMETERS set here will override anything set in cucumber.json | ||
run: | | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,3 +27,4 @@ newrelic_agent.log | |
|
||
# playwright | ||
playwright-report | ||
test-results |
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 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,3 @@ | ||
version: "3" | ||
|
||
services: | ||
web: | ||
container_name: sfr-bookfinder-front-end | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
export const NYPL_LOGIN_URL = "https://login.nypl.org/auth/login?redirect_uri="; | ||
export const API_URL = "https://backend.msw"; | ||
export const FULFILL_PATH = "/fulfill/12345"; | ||
export const LIMITED_ACCESS_WORK_PATH = | ||
"/work/12345678-1234-1234-1234-1234567890ab"; | ||
export const FULFILL_PATH = "/fulfill/9351827"; | ||
export const LIMITED_ACCESS_EDITION_PATH = "/edition/6977884"; | ||
export const WORK_PATH = "/work/5950e6df-9d99-42fe-8924-1116166a2acb"; | ||
export const DOWNLOAD_PATH = "/test-download-pdf"; | ||
export const HOME_PATH = "/"; | ||
export const COLLECTION_LIST_PATH = "/collection/list"; | ||
export const COLLECTION_PATH = | ||
"/collection/978ea0e0-8ecc-4de2-bfe8-032fea641d8e?page=1"; | ||
export const INVALID_COLLECTION_PATH = "/collection/invalid-collection"; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,24 @@ | ||
import { test, expect } from "../support/test-utils"; | ||
import { | ||
INVALID_COLLECTION_PATH, | ||
HOME_PATH, | ||
COLLECTION_PATH, | ||
} from "~/mocks/mockEnv"; | ||
import { INVALID_COLLECTION_PATH, HOME_PATH } from "~/mocks/mockEnv"; | ||
import { server } from "~/mocks/server"; | ||
import { | ||
SEARCH_BAR_TEST_ID, | ||
ERROR_LAYOUT_TEST_ID, | ||
} from "~/src/constants/testIds"; | ||
|
||
test.afterEach(() => server.resetHandlers()); | ||
test.afterAll(() => server.close()); | ||
|
||
test("View landing page with collection", async ({ page, port }) => { | ||
await page.goto(`http://localhost:${port}${HOME_PATH}`); | ||
const collectionHeading = page.getByRole("heading", { | ||
name: "Recently Added Collections", | ||
level: 2, | ||
}); | ||
expect(collectionHeading).toBeVisible(); | ||
const collectionLink = await page | ||
.getByRole("link", { | ||
name: /Baseball: A Collection by Mike Benowitz/, | ||
}) | ||
.getAttribute("href"); | ||
expect(collectionLink).toContain(COLLECTION_PATH); | ||
test("View landing page with search", async ({ page }) => { | ||
await page.goto(`${HOME_PATH}`); | ||
|
||
const searchBar = page.getByTestId(SEARCH_BAR_TEST_ID); | ||
await expect(searchBar).toBeVisible(); | ||
}); | ||
|
||
test("Shows error boundary for invalid collection", async ({ page, port }) => { | ||
await page.goto(`http://localhost:${port}${INVALID_COLLECTION_PATH}`); | ||
test("Shows error page for invalid collection", async ({ page }) => { | ||
await page.goto(`${INVALID_COLLECTION_PATH}`); | ||
|
||
const alert = page.getByRole("alert"); | ||
const errorText = alert.getByText("Something went wrong on our end"); | ||
await expect(errorText).toBeVisible(); | ||
const errorLayout = page.getByTestId(ERROR_LAYOUT_TEST_ID); | ||
await expect(errorLayout).toBeVisible(); | ||
}); |
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export const SEARCH_BAR_TEST_ID = "search-bar"; | ||
export const ERROR_LAYOUT_TEST_ID = "error-layout"; | ||
export const LOGIN_TO_READ_TEST_ID = "login-to-read"; | ||
export const LOGIN_TO_DOWNLOAD_TEST_ID = "login-to-download"; |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Version is obsolete!