From f37dcb437e8eb35b35607bfd578956e02faa9157 Mon Sep 17 00:00:00 2001 From: sagely1 <114952739+sagely1@users.noreply.github.com> Date: Mon, 4 Dec 2023 00:12:49 -0800 Subject: [PATCH 1/4] AG-1213 add AMP-PD explorer link --- .../gene-resources.component.html | 3 +-- .../gene-resources.component.ts | 6 +++++ tests/gene-resources.spec.ts | 24 +++++++++++++++++++ 3 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 tests/gene-resources.spec.ts diff --git a/src/app/features/genes/components/gene-resources/gene-resources.component.html b/src/app/features/genes/components/gene-resources/gene-resources.component.html index 8321000a..a3b06208 100644 --- a/src/app/features/genes/components/gene-resources/gene-resources.component.html +++ b/src/app/features/genes/components/gene-resources/gene-resources.component.html @@ -63,8 +63,7 @@

Target Enabling Resources

Additional Resources

- These external sites provide useful AD-specific or general information - for exploring targets. + These external sites provide additional useful information for exploring AD targets.

{ + test.use({ viewport: { width: 1600, height: 1200 } }); + + test('has title', async ({ page }) => { + await page.goto('/genes/ENSG00000178209/resources'); + + // Expect a title "to contain" a substring. + await expect(page).toHaveTitle('Agora'); + }); + + test('AMP-PD explorer link to go to gene', async ({ page }) => { + await page.goto('/genes/ENSG00000178209/resources'); + + // expect link named 'Visit AMP-PD' + const link = page.getByRole('link', { name: 'Visit AMP-PD' }); + expect(await link.innerText()).toBe('Visit AMP-PD'); + + // expect url to have ensembleid + const url = await link.getAttribute('href'); + expect(url).toBe('https://target-explorer.amp-pd.org/genes/target-search?gene=ENSG00000178209'); + }); +}); \ No newline at end of file From e8d78de1e5a7e5c9a1844d7225e6f6179fc3bb6c Mon Sep 17 00:00:00 2001 From: sagely1 <114952739+sagely1@users.noreply.github.com> Date: Mon, 4 Dec 2023 00:12:49 -0800 Subject: [PATCH 2/4] AG-1213 add AMP-PD explorer link --- .../gene-resources.component.html | 3 +-- .../gene-resources.component.ts | 6 +++++ tests/gene-resources.spec.ts | 24 +++++++++++++++++++ 3 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 tests/gene-resources.spec.ts diff --git a/src/app/features/genes/components/gene-resources/gene-resources.component.html b/src/app/features/genes/components/gene-resources/gene-resources.component.html index 8321000a..a3b06208 100644 --- a/src/app/features/genes/components/gene-resources/gene-resources.component.html +++ b/src/app/features/genes/components/gene-resources/gene-resources.component.html @@ -63,8 +63,7 @@

Target Enabling Resources

Additional Resources

- These external sites provide useful AD-specific or general information - for exploring targets. + These external sites provide additional useful information for exploring AD targets.

{ + test.use({ viewport: { width: 1600, height: 1200 } }); + + test('has title', async ({ page }) => { + await page.goto('/genes/ENSG00000178209/resources'); + + // Expect a title "to contain" a substring. + await expect(page).toHaveTitle('Agora'); + }); + + test('AMP-PD explorer link to go to gene', async ({ page }) => { + await page.goto('/genes/ENSG00000178209/resources'); + + // expect link named 'Visit AMP-PD' + const link = page.getByRole('link', { name: 'Visit AMP-PD' }); + expect(await link.innerText()).toBe('Visit AMP-PD'); + + // expect url to have ensembleid + const url = await link.getAttribute('href'); + expect(url).toBe('https://target-explorer.amp-pd.org/genes/target-search?gene=ENSG00000178209'); + }); +}); \ No newline at end of file From a9d6f15377156505eddf03ed0447e009788654c5 Mon Sep 17 00:00:00 2001 From: sagely1 <114952739+sagely1@users.noreply.github.com> Date: Mon, 4 Dec 2023 01:24:50 -0800 Subject: [PATCH 3/4] remove playwright from travis for now --- .travis.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index fd479b42..a8abde98 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,8 +26,6 @@ before_script: - echo -e "[ci-user-prod]\naws_access_key_id=${AwsTravisAccessKey_prod}\naws_secret_access_key=${AwsTravisSecretAccessKey_prod}\n" >> ~/.aws/credentials # setup npm dependencies - npm install - # setup playwright dependencies - - npx playwright install --with-deps stages: - name: test - name: eb-deploy-develop @@ -41,8 +39,6 @@ jobs: script: - npm run test - npm run build - - npm run start & - - npx playwright test - stage: deploy-develop if: (NOT type IN (pull_request)) AND (branch = develop) node_js: 16.15.0 From fc5a9010508bcb7b46afdb6dcb3f789e89e99683 Mon Sep 17 00:00:00 2001 From: sagely1 <114952739+sagely1@users.noreply.github.com> Date: Tue, 5 Dec 2023 12:52:52 -0800 Subject: [PATCH 4/4] Update test to use auto-retrying assertions Co-authored-by: hallieswan <26949006+hallieswan@users.noreply.github.com> --- tests/gene-resources.spec.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/gene-resources.spec.ts b/tests/gene-resources.spec.ts index 3ace8d47..5a94b391 100644 --- a/tests/gene-resources.spec.ts +++ b/tests/gene-resources.spec.ts @@ -15,10 +15,9 @@ test.describe('specific viewport block', () => { // expect link named 'Visit AMP-PD' const link = page.getByRole('link', { name: 'Visit AMP-PD' }); - expect(await link.innerText()).toBe('Visit AMP-PD'); + await expect(link).toHaveText('Visit AMP-PD'); // expect url to have ensembleid - const url = await link.getAttribute('href'); - expect(url).toBe('https://target-explorer.amp-pd.org/genes/target-search?gene=ENSG00000178209'); + await expect(link).toHaveAttribute('href', 'https://target-explorer.amp-pd.org/genes/target-search?gene=ENSG00000178209'); }); }); \ No newline at end of file