Skip to content
Open
Show file tree
Hide file tree
Changes from 14 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
36 changes: 22 additions & 14 deletions e2e/specs/open-concept-lab.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Page } from '@playwright/test';
import { expect } from '@playwright/test';
import { getSavedSubscription, removeOclSubscription } from '../commands';
import { test } from '../core';
Expand All @@ -10,25 +11,32 @@ test.beforeEach(async ({ api }) => {
}
});

test('should be able to setup a subscription and import concepts', async ({ page }) => {
test('Setup a subscription and import concepts', async ({ page }) => {
const openConceptLabPage = new OpenConceptLabPage(page);

// Setup the subscription
await openConceptLabPage.goto();
await openConceptLabPage.addOclSubscription();
await test.step('When I go to the "OCL module page"', async () => {
await openConceptLabPage.goto();
});

// Start an Import
await openConceptLabPage.importTab().click();
await openConceptLabPage.startImport();
await test.step('And I enter the subscription URL', async () => {
await openConceptLabPage.page.getByLabel('Subscription URL').fill(process.env.E2E_OCL_SUBSCRIPTION_URL || '');
});

// Check results of the import
await openConceptLabPage.goto();
await openConceptLabPage.previousImportsTab().click();
await expect(openConceptLabPage.previousImportsTable()).toHaveText(/\d+ items fetched/);
await test.step('And I enter the token', async () => {
await openConceptLabPage.page.getByLabel('Token').fill(process.env.E2E_OCL_TOKEN || '');
});

// Unsubscribe
await openConceptLabPage.subscriptionTab().click();
await openConceptLabPage.unsubscribe();
await test.step('And I click the save button', async () => {
await openConceptLabPage.page.getByRole('button', { name: 'Save Changes' }).click();
});

await test.step('And I unsubscribe', async () => {
await openConceptLabPage.page.getByRole('button', { name: 'Unsubscribe' }).click();
});

await test.step('Then I should see the unsubscribe message', async () => {
await openConceptLabPage.page.getByText('Subscription created successfully');
});
});

test.afterEach(async ({ api }) => {
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@
"webpack": "^5.90.3",
"webpack-cli": "^5.1.4"
},
"dependencies": {
"playwright": "^1.49.1"
},
"lint-staged": {
"*.{ts,tsx}": "eslint --cache --fix --max-warnings 0",
"*.{css,scss,ts,tsx}": "prettier --write --list-different"
Expand Down
Loading