Skip to content
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

Update for pass-auth consolidation #16

Merged
merged 2 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .github/actions/acceptance-test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ runs:
echo "Set timeouts: ${{ inputs.timeouts }}"
shell: bash

- name: Append hosts file to enable "pass.local" on localhost
shell: bash
run: echo "127.0.0.1 pass.local" | sudo tee -a /etc/hosts

- name: Checkout pass-docker
uses: actions/checkout@v3
with:
Expand Down
18 changes: 9 additions & 9 deletions tests/baseCaseTests.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { fixture, Selector, test } from 'testcafe';
import { currLocation, TIMEOUT_LENGTH, login } from './commonTest';

fixture`Acceptance Testing`.page`https://pass.local`;
fixture`Acceptance Testing`.page`http://localhost:8080`;

test('can walk through an nih submission workflow and make a submission - base case', async (t) => {
// Log in
Expand All @@ -14,7 +14,7 @@ test('can walk through an nih submission workflow and make a submission - base c
await t.expect(submissionsButton.exists).ok();
await t.click(submissionsButton);

await t.expect(currLocation()).eql('https://pass.local/app/submissions');
await t.expect(currLocation()).eql('http://localhost:8080/app/submissions');

// Start new Submission
const startNewSubmissionButton = Selector(
Expand All @@ -25,7 +25,7 @@ test('can walk through an nih submission workflow and make a submission - base c

await t
.expect(currLocation())
.eql('https://pass.local/app/submissions/new/basics');
.eql('http://localhost:8080/app/submissions/new/basics');

// Input DOI
const doiInput = Selector('#doi');
Expand Down Expand Up @@ -67,7 +67,7 @@ test('can walk through an nih submission workflow and make a submission - base c

await t
.expect(currLocation())
.eql('https://pass.local/app/submissions/new/grants');
.eql('http://localhost:8080/app/submissions/new/grants');

// Select a Grant
const nihGrant = Selector('#grants-selection-table a').withText('QQDV123P7');
Expand All @@ -91,7 +91,7 @@ test('can walk through an nih submission workflow and make a submission - base c

await t
.expect(currLocation())
.eql('https://pass.local/app/submissions/new/policies');
.eql('http://localhost:8080/app/submissions/new/policies');

// Check selected Policy
const currPolicy = Selector('input').withAttribute(
Expand All @@ -108,7 +108,7 @@ test('can walk through an nih submission workflow and make a submission - base c

await t
.expect(currLocation())
.eql('https://pass.local/app/submissions/new/repositories');
.eql('http://localhost:8080/app/submissions/new/repositories');

// Check Required Repositories
const requiredRepositories = Selector('ul')
Expand All @@ -134,7 +134,7 @@ test('can walk through an nih submission workflow and make a submission - base c

await t
.expect(currLocation())
.eql('https://pass.local/app/submissions/new/metadata');
.eql('http://localhost:8080/app/submissions/new/metadata');

// Check Article Title
const articleTitle = Selector('textarea').withAttribute('name', 'title');
Expand All @@ -155,7 +155,7 @@ test('can walk through an nih submission workflow and make a submission - base c

await t
.expect(currLocation())
.eql('https://pass.local/app/submissions/new/files');
.eql('http://localhost:8080/app/submissions/new/files');

// Get Browse Files button
const browseFilesButton = Selector('#file-multiple-input');
Expand All @@ -181,7 +181,7 @@ test('can walk through an nih submission workflow and make a submission - base c

await t
.expect(currLocation())
.eql('https://pass.local/app/submissions/new/review');
.eql('http://localhost:8080/app/submissions/new/review');

// Review Title
const reviewTitle = Selector('.mb-1').withAttribute(
Expand Down
2 changes: 1 addition & 1 deletion tests/commonTest.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Selector, ClientFunction, t } from 'testcafe';

const LOGIN_URL = 'https://pass.local/login/saml';
const LOGIN_URL = 'http://localhost:8080/app/';

export const USER = {
NIH_USER: 'nih-user',
Expand Down
18 changes: 9 additions & 9 deletions tests/noJournalTests.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { fixture, Selector, test } from 'testcafe';
import { currLocation, TIMEOUT_LENGTH, login } from './commonTest';

fixture`Acceptance Testing`.page`https://pass.local`;
fixture`Acceptance Testing`.page`http://localhost:8080`;

test('can walk through an nih submission workflow and make a submission - without selecting a journal', async (t) => {
// Log in
Expand All @@ -14,7 +14,7 @@ test('can walk through an nih submission workflow and make a submission - withou
await t.expect(submissionsButton.exists).ok();
await t.click(submissionsButton);

await t.expect(currLocation()).eql('https://pass.local/app/submissions');
await t.expect(currLocation()).eql('http://localhost:8080/app/submissions');

// Start new Submission
const startNewSubmissionButton = Selector(
Expand All @@ -25,7 +25,7 @@ test('can walk through an nih submission workflow and make a submission - withou

await t
.expect(currLocation())
.eql('https://pass.local/app/submissions/new/basics');
.eql('http://localhost:8080/app/submissions/new/basics');

// do not enter a DOI and enter a title manually
const titleName = Selector('#title');
Expand All @@ -48,7 +48,7 @@ test('can walk through an nih submission workflow and make a submission - withou

await t
.expect(currLocation())
.eql('https://pass.local/app/submissions/new/grants');
.eql('http://localhost:8080/app/submissions/new/grants');

// Select a Grant
const nihGrant = Selector('#grants-selection-table a').withText('Z0650001');
Expand All @@ -72,7 +72,7 @@ test('can walk through an nih submission workflow and make a submission - withou

await t
.expect(currLocation())
.eql('https://pass.local/app/submissions/new/policies');
.eql('http://localhost:8080/app/submissions/new/policies');

// Check that JHU policy exists
const jhuRepository = Selector('h3')
Expand All @@ -89,7 +89,7 @@ test('can walk through an nih submission workflow and make a submission - withou

await t
.expect(currLocation())
.eql('https://pass.local/app/submissions/new/repositories');
.eql('http://localhost:8080/app/submissions/new/repositories');

// Check Required Repositories
const requiredRepositories = Selector('ul')
Expand All @@ -107,7 +107,7 @@ test('can walk through an nih submission workflow and make a submission - withou

await t
.expect(currLocation())
.eql('https://pass.local/app/submissions/new/metadata');
.eql('http://localhost:8080/app/submissions/new/metadata');

// Check Article Title
const articleTitle = Selector('textarea').withAttribute('name', 'title');
Expand All @@ -134,7 +134,7 @@ test('can walk through an nih submission workflow and make a submission - withou

await t
.expect(currLocation())
.eql('https://pass.local/app/submissions/new/files');
.eql('http://localhost:8080/app/submissions/new/files');

// Get Browse Files button
const browseFilesButton = Selector('#file-multiple-input');
Expand All @@ -160,7 +160,7 @@ test('can walk through an nih submission workflow and make a submission - withou

await t
.expect(currLocation())
.eql('https://pass.local/app/submissions/new/review');
.eql('http://localhost:8080/app/submissions/new/review');

// Review Title
const reviewTitle = Selector('.mb-1').withAttribute(
Expand Down
22 changes: 11 additions & 11 deletions tests/proxySubmissionTests.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { fixture, Selector, test } from 'testcafe';
import { currLocation, TIMEOUT_LENGTH, login, logout } from './commonTest';

fixture`Acceptance Testing`.page`https://pass.local`.afterEach(logout);
fixture`Acceptance Testing`.page`http://localhost:8080`.afterEach(logout);

test('can walk through a proxy submission workflow and make a submission - with pass account', async (t) => {
// use role
Expand All @@ -15,7 +15,7 @@ test('can walk through a proxy submission workflow and make a submission - with
await t.expect(submissionsButton.exists).ok();
await t.click(submissionsButton);

await t.expect(currLocation()).eql('https://pass.local/app/submissions');
await t.expect(currLocation()).eql('http://localhost:8080/app/submissions');

// Start new Submission
const startNewSubmissionButton = Selector(
Expand All @@ -27,7 +27,7 @@ test('can walk through a proxy submission workflow and make a submission - with
// Select Proxy Submission button
await t
.expect(currLocation())
.eql('https://pass.local/app/submissions/new/basics');
.eql('http://localhost:8080/app/submissions/new/basics');
const proxyRadioButton = Selector('input').withAttribute(
'data-test-proxy-radio-button'
);
Expand Down Expand Up @@ -77,7 +77,7 @@ test('can walk through a proxy submission workflow and make a submission - witho
await t.expect(submissionsButton.exists).ok();
await t.click(submissionsButton);

await t.expect(currLocation()).eql('https://pass.local/app/submissions');
await t.expect(currLocation()).eql('http://localhost:8080/app/submissions');

// Start new Submission
const startNewSubmissionButton = Selector(
Expand All @@ -89,7 +89,7 @@ test('can walk through a proxy submission workflow and make a submission - witho
// Select Proxy Submission button
await t
.expect(currLocation())
.eql('https://pass.local/app/submissions/new/basics');
.eql('http://localhost:8080/app/submissions/new/basics');
const proxyRadioButton = Selector('input').withAttribute(
'data-test-proxy-radio-button'
);
Expand Down Expand Up @@ -159,7 +159,7 @@ async function walkThroughSubmissionFlow(t, hasAccount) {

await t
.expect(currLocation())
.eql('https://pass.local/app/submissions/new/grants');
.eql('http://localhost:8080/app/submissions/new/grants');

if (hasAccount) {
// Select a Grant
Expand Down Expand Up @@ -202,7 +202,7 @@ async function walkThroughSubmissionFlow(t, hasAccount) {

await t
.expect(currLocation())
.eql('https://pass.local/app/submissions/new/policies');
.eql('http://localhost:8080/app/submissions/new/policies');

// Nothing to select here, move to Repositories page
const goToRepositoriesButton = Selector('button').withAttribute(
Expand All @@ -212,7 +212,7 @@ async function walkThroughSubmissionFlow(t, hasAccount) {
await t.click(goToRepositoriesButton);
await t
.expect(currLocation())
.eql('https://pass.local/app/submissions/new/repositories');
.eql('http://localhost:8080/app/submissions/new/repositories');

// Check Required Repositories
if (hasAccount) {
Expand Down Expand Up @@ -244,7 +244,7 @@ async function walkThroughSubmissionFlow(t, hasAccount) {

await t
.expect(currLocation())
.eql('https://pass.local/app/submissions/new/metadata');
.eql('http://localhost:8080/app/submissions/new/metadata');

// Check Article Title
const articleTitle = Selector('textarea').withAttribute('name', 'title');
Expand All @@ -265,7 +265,7 @@ async function walkThroughSubmissionFlow(t, hasAccount) {

await t
.expect(currLocation())
.eql('https://pass.local/app/submissions/new/files');
.eql('http://localhost:8080/app/submissions/new/files');

await t.expect(Selector('div[data-test-foundmss-component]').exists).ok();

Expand All @@ -287,7 +287,7 @@ async function walkThroughSubmissionFlow(t, hasAccount) {

await t
.expect(currLocation())
.eql('https://pass.local/app/submissions/new/review');
.eql('http://localhost:8080/app/submissions/new/review');

// Go to Review
// Review Title
Expand Down
Loading