Skip to content

Commit 3ad3816

Browse files
committed
fix tests
1 parent 1a99b8b commit 3ad3816

1 file changed

Lines changed: 13 additions & 34 deletions

File tree

e2e/tests/functional/planning/timestrip.e2e.spec.js

Lines changed: 13 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ import {
2424
createDomainObjectWithDefaults,
2525
createPlanFromJSON,
2626
navigateToObjectWithFixedTimeBounds,
27+
navigateToObjectWithRealTime,
2728
setEndOffset,
2829
setFixedIndependentTimeConductorBounds,
2930
setFixedTimeMode,
30-
setRealTimeMode,
3131
setTimeConductorBounds
3232
} from '../../../appActions.js';
3333
import { expect, test } from '../../../pluginFixtures.js';
@@ -85,32 +85,13 @@ test.describe('Time Strip', () => {
8585
// Goto baseURL
8686
await page.goto('./', { waitUntil: 'domcontentloaded' });
8787

88-
timestrip = await test.step('Create a Time Strip', async () => {
89-
const createdTimeStrip = await createDomainObjectWithDefaults(page, { type: 'Time Strip' });
90-
const objectName = await page.locator('.l-browse-bar__object-name').innerText();
91-
expect(objectName).toBe(createdTimeStrip.name);
92-
93-
return createdTimeStrip;
94-
});
95-
96-
plan = await test.step('Create a Plan and add it to the timestrip', async () => {
97-
const createdPlan = await createPlanFromJSON(page, {
98-
name: 'Test Plan',
99-
json: testPlan
100-
});
101-
102-
await page.goto(timestrip.url);
103-
// Expand the tree to show the plan
104-
await page.getByLabel('Show selected item in tree').click();
105-
await page
106-
.getByLabel(`Navigate to ${createdPlan.name}`)
107-
.dragTo(page.getByLabel('Object View'));
108-
await page.getByLabel('Save').click();
109-
await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click();
110-
111-
return createdPlan;
88+
timestrip = await createDomainObjectWithDefaults(page, { type: 'Time Strip' });
89+
plan = await createPlanFromJSON(page, {
90+
json: testPlan,
91+
parent: timestrip.uuid
11292
});
11393
});
94+
11495
test('Create two Time Strips, add a single Plan to both, and verify they can have separate Independent Time Contexts', async ({
11596
page
11697
}) => {
@@ -152,19 +133,17 @@ test.describe('Time Strip', () => {
152133

153134
await test.step('Can have multiple TimeStrips with the same plan linked and different Independent Time Contexts', async () => {
154135
// Create another Time Strip and verify that it has been created
155-
const createdTimeStrip = await createDomainObjectWithDefaults(page, {
136+
const secondTimeStrip = await createDomainObjectWithDefaults(page, {
156137
type: 'Time Strip',
157138
name: 'Another Time Strip'
158139
});
159140

160-
const objectName = await page.locator('.l-browse-bar__object-name').innerText();
161-
expect(objectName).toBe(createdTimeStrip.name);
162-
163-
// Drag the existing Plan onto the newly created Time Strip, and save.
164-
await page.getByLabel(`Navigate to ${plan.name}`).dragTo(page.getByLabel('Object View'));
165-
await page.getByLabel('Save').click();
166-
await page.getByRole('listitem', { name: 'Save and Finish Editing' }).click();
141+
await createPlanFromJSON(page, {
142+
json: testPlan,
143+
parent: secondTimeStrip.uuid
144+
});
167145

146+
await navigateToObjectWithFixedTimeBounds(page, secondTimeStrip.url);
168147
// All events should be displayed at this point because the
169148
// initial independent context bounds will match the global bounds
170149
expect(await activityBounds.count()).toEqual(5);
@@ -235,7 +214,7 @@ test.describe('Time Strip', () => {
235214

236215
test('Time strip ahead/behind line', async ({ page }) => {
237216
const aheadBehindMarker = page.getByLabel('Ahead Behind Marker');
238-
await setRealTimeMode(page);
217+
await navigateToObjectWithRealTime(page, timestrip.url);
239218
await setEndOffset(page, {
240219
endMins: '15',
241220
endSecs: '00'

0 commit comments

Comments
 (0)