-
Notifications
You must be signed in to change notification settings - Fork 0
ETT-1241: fix section 108 access #177
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
a7c08a4
Fix typo in setup script for geoip
aelkiss 2a57dd2
ETT-636: update catalog-in-babel health check for php 8
aelkiss a0902b7
Fix typo for querying for BRLM access (from ETT-320)
aelkiss e14da11
Get rid of apache vs. apache-test distinction
aelkiss 71b169f
ETT-346, ETT-1241 - Playwright tests for ETAS & section 108
aelkiss a9154fd
fix geoip link in setup.sh for mac os x ln (no -r option)
aelkiss 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 hidden or 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 hidden or 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 hidden or 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,30 @@ | ||
| # Optional service (not required for core functionality testing) | ||
| # As we want to test these via playwright, they could move into core.yml | ||
|
|
||
| x-healthcheck-defaults: &healthcheck-defaults | ||
|
Contributor
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. There's no need for these variables on line 4 to 8 in this file since the health checks are present on lines 25 to 30. I would opt for removing these lines instead of 20-30 so that it's simpler to read and maintain. |
||
| interval: 5s | ||
| timeout: 10s | ||
| start_period: 10s | ||
| retries: 5 | ||
|
|
||
| services: | ||
| vufind: | ||
| build: ../../catalog #TODO: Use the built unstable container | ||
| hostname: 'catalog-dev' | ||
| volumes: | ||
| - ${BABEL_HOME}/catalog:/app | ||
| - ${BABEL_HOME}/firebird-common:/htapps/babel/firebird-common | ||
| - ${BABEL_HOME}/catalog/conf/authspecs-sample.yaml:/app/conf/authspecs.yaml | ||
| environment: | ||
| - FIREBIRD_HOME=/htapps/babel/firebird-common | ||
| depends_on: | ||
| mysql-sdr: | ||
| condition: service_healthy | ||
| solr-sdr-catalog: | ||
| condition: service_healthy | ||
| healthcheck: | ||
| interval: 5s | ||
| timeout: 10s | ||
| start_period: 10s | ||
| retries: 5 | ||
| test: "service php8.4-fpm status | grep running" | ||
This file contains hidden or 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 hidden or 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,34 @@ | ||
| # Optional services (not required for core functionality testing) | ||
| # As we want to test these via playwright, they should move into core.yml | ||
|
|
||
| x-healthcheck-defaults: &healthcheck-defaults | ||
| interval: 5s | ||
| timeout: 10s | ||
| start_period: 10s | ||
| retries: 5 | ||
|
|
||
| services: | ||
| solr-lss-dev: | ||
| # This is another core service | ||
| image: solr:6.6.6-alpine | ||
| ports: | ||
| - "8983:8983" | ||
| user: ${CURRENT_USER} | ||
| volumes: | ||
| - ${BABEL_HOME}/lss_solr_configs/solr6_standalone/lss-dev/core-x:/opt/solr/server/solr/core-x | ||
| - ${BABEL_HOME}/lss_solr_configs/solr6_standalone/lss-dev/core-y:/opt/solr/server/solr/core-y | ||
| - ${BABEL_HOME}/lss_solr_configs/solr6_standalone:/opt/lss_solr_configs | ||
| - ${BABEL_HOME}/lss_solr_configs/solr6_standalone/lib:/opt/solr/server/solr/lib | ||
| - ${BABEL_HOME}/logs/solr:/opt/solr/server/logs | ||
| healthcheck: | ||
| <<: *healthcheck-defaults | ||
| test: "ping -c 1 solr-lss-dev:8983" | ||
|
|
||
| solr-ptsearch: | ||
| # This is a core service | ||
| build: ../../ptsearch-solr #TODO: Build from image in ghcr.io | ||
| ports: | ||
| - "8984:8983" | ||
| healthcheck: | ||
| <<: *healthcheck-defaults | ||
| test: "curl -f --retry-connrefused http://solr-ptsearch:8983/solr/ptsearch/admin/ping" |
This file contains hidden or 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 hidden or 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 hidden or 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 @@ | ||
| {"brlm_count":1,"copy_count":1,"currently_held_count":1,"deposited":0,"format":"spm","n_enum":"","ocns":[123456]} |
This file contains hidden or 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 hidden or 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,60 @@ | ||
| // @ts-check | ||
| import { defineConfig, devices } from '@playwright/test'; | ||
|
|
||
| let testUrl; | ||
| if (process.env.LOCAL == 'local') { | ||
| testUrl = 'http://localhost:8080'; | ||
| } else { | ||
| testUrl = 'http://apache:8080'; | ||
| } | ||
|
|
||
| /** | ||
| * Read environment variables from file. | ||
| * https://github.com/motdotla/dotenv | ||
| */ | ||
| // import dotenv from 'dotenv'; | ||
| // import path from 'path'; | ||
| // dotenv.config({ path: path.resolve(__dirname, '.env') }); | ||
|
|
||
| /** | ||
| * @see https://playwright.dev/docs/test-configuration | ||
| */ | ||
| export default defineConfig({ | ||
| testDir: './tests', | ||
| testMatch: /(.+\.)?(test|spec)\.[jt]s/, | ||
| /* Run tests in files in parallel */ | ||
| fullyParallel: true, | ||
| /* Fail the build on CI if you accidentally left test.only in the source code. */ | ||
| forbidOnly: !!process.env.CI, | ||
| /* Retry authed tests -- there may be occasional race conditions with apache reloading its config */ | ||
| retries: 2, | ||
| /* Don't run authed tests in parallel -- sessions may interfere with each other, esp. for ETAS / section 108 */ | ||
| workers: 1, | ||
| /* Reporter to use. See https://playwright.dev/docs/test-reporters */ | ||
| // reporter: process.env.CI ? '["list", "html"]' : 'list', | ||
| reporter: [['list'], ['html', { open: 'never' }]], | ||
| /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ | ||
| use: { | ||
| /* Base URL to use in actions like `await page.goto('/')`. */ | ||
| baseURL: testUrl, | ||
|
|
||
| /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ | ||
| trace: 'retain-on-failure', | ||
| // trace: 'on', | ||
| }, | ||
|
|
||
| /* Configure projects for major browsers */ | ||
| projects: [ | ||
| { | ||
| name: 'chromium', | ||
| use: { ...devices['Desktop Chrome'] }, | ||
| }, | ||
| ], | ||
|
|
||
| /* Run your local dev server before starting the tests */ | ||
| // webServer: { | ||
| // command: 'npm run babel', | ||
| // url: 'http://127.0.0.1:3000', | ||
| // reuseExistingServer: !process.env.CI, | ||
| // }, | ||
| }); |
37 changes: 37 additions & 0 deletions
37
pt/web/firebird/tests/auth_emergency_access_affiliate.spec.js
This file contains hidden or 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,37 @@ | ||
| import { expect, test } from '@playwright/test'; | ||
| import fs from 'fs'; | ||
|
|
||
| test.describe('emergency_access_affiliate access to ic material', () => { | ||
| test.beforeEach(async ({ page }) => { | ||
| await page.goto('/cgi/pt?id=test.pd_open'); | ||
| await page.getByRole('button', { name: 'Allow all cookies' }).click(); | ||
| }); | ||
|
|
||
| test('pageturner loads image for ic_currently_held after checkout', async ({ page }) => { | ||
| await page.goto('/cgi/pt?id=test.ic_currently_held'); | ||
|
|
||
| await expect(page.getByRole('figure')).toHaveCount(0); | ||
| await page.getByRole('link', { name: 'Check Out' }).click(); | ||
| await expect(page.getByRole('figure')).toBeVisible(); | ||
| await page.getByRole('link', { name: 'Return Early' }).click(); | ||
| await expect(page.getByRole('figure')).toHaveCount(0); | ||
| }); | ||
|
|
||
| // resource sharing users cannot see lost/missing/withdrawn material | ||
| test('pageturner loads image for ic_not_current after checkout', async ({ page }) => { | ||
| await page.goto('/cgi/pt?id=test.ic_not_current'); | ||
|
|
||
| await expect(page.getByRole('figure')).toHaveCount(0); | ||
| await page.getByRole('link', { name: 'Check Out' }).click(); | ||
| await expect(page.getByRole('figure')).toBeVisible(); | ||
| await page.getByRole('link', { name: 'Return Early' }).click(); | ||
| await expect(page.getByRole('figure')).toHaveCount(0); | ||
| }); | ||
|
|
||
| test('pageturner does not load image or show checkout for ic_not_held', async ({ page }) => { | ||
| await page.goto('/cgi/pt?id=test.ic_not_held'); | ||
| await expect(page.getByText('not available online')).toHaveCount(1); | ||
| await expect(page.getByRole('link', { name: 'Check Out' })).toHaveCount(0); | ||
| await expect(page.getByRole('figure')).toHaveCount(0); | ||
| }); | ||
| }); |
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.
Need to clear
pt_exclusivity_ngto start with a blank slate for ETAS and section 108 testing. Ideally, could clear it before every test; not sure we have a good way to do that; should work as-is though.