Skip to content
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: 2 additions & 2 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ name: Docker deploy

on:
push:
branches: [ "development_2.1" ]
branches: [ "development_2.1", "release/2.x-fixes" ]
# Publish semver tags as releases.
tags: [ 'v*.*.*' ]
pull_request:
branches: [ "development_2.1" ]
branches: [ "development_2.1", "release/2.x-fixes" ]

env:
REGISTRY: ghcr.io
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

npm run build &
npm run dockerize &
pid=$!
sleep 90
kill -9 $pid
Expand Down
9 changes: 4 additions & 5 deletions e2e-tests/pages/AccessPermissionsTab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,28 @@ export class AccessPermissionsTab extends BasePage {
}

private get usernameInput() {
return this.page.getByRole('textbox', { name: 'Username' });
return this.page.getByLabel('Select User');
}

private get roleInput() {
return this.page.getByRole('textbox', { name: 'Role' });
return this.page.getByLabel('Assign Role');
}

private get addButton() {
return this.page.getByRole('Button', {name: 'add'});
return this.page.getByRole('button', { name: 'Grant Access' });
}

async addPermission(username: string, role: string) {
await this.usernameInput.click();
await this.usernameInput.fill(username);
await this.page.getByRole('option', { name: username }).click();

await this.roleInput.click();
await this.page.getByRole("option", {name: role}).click();


await this.addButton.click();
await expect(this.page.getByRole("cell", {name: username})).toBeVisible();
await expect(this.page.getByRole("cell", {name: role})).toBeVisible();

}
}

Expand Down
4 changes: 2 additions & 2 deletions e2e-tests/pages/ActivityPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export class ActivityPage extends BasePage {
}

private get createButton() {
return this.page.getByRole('button', { name: 'Create' });
return this.page.getByRole('button', { name: 'Create new activity' });
}

private get nameInput() {
Expand All @@ -23,7 +23,7 @@ export class ActivityPage extends BasePage {
}

private get createActivityButton() {
return this.page.getByRole('button', { name: 'Create new activity' });
return this.page.getByRole('button', { name: 'Create activity' });
}


Expand Down
1 change: 1 addition & 0 deletions e2e-tests/pages/DatasetCreatePage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { BasePage } from './BasePage';
export class DatasetCreatePage extends BasePage {
async visit(): Promise<void> {
await this.page.goto('/datasets/create');
await this.page.waitForLoadState('networkidle');
await this.waitForPageLoad();
}

Expand Down
4 changes: 2 additions & 2 deletions e2e-tests/pages/DatasetListPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ export class DatasetListPage extends BasePage {
await expect(card).toContainText(dataset.name);
await expect(card).toContainText(dataset.creator);
await expect(card).toContainText(dataset.rights);
await expect(card).toContainText(dataset.date);
await expect(card).toContainText(dataset.description);
// await expect(card).toContainText(dataset.date);
// await expect(card).toContainText(dataset.description);
}

async useAnyDataset(): Promise<void> {
Expand Down
2 changes: 1 addition & 1 deletion e2e-tests/pages/ExperimentPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class ExperimentPage extends BasePage {
}

private get createExperimentButton() {
return this.page.getByRole('button', { name: 'Create new experiment' });
return this.page.getByRole('button', { name: 'Create experiment' });
}

async visit(): Promise<void> {
Expand Down
5 changes: 3 additions & 2 deletions e2e-tests/pages/LoginPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { BasePage } from './BasePage';

export class LoginPage extends BasePage {
private get loginInput() {
return this.page.getByLabel('Username or email');
return this.page.getByPlaceholder('Username or email');
}

private get passwordInput() {
return this.page.getByLabel('Password');
return this.page.getByPlaceholder('Password');
}

private get loginButton() {
Expand All @@ -16,6 +16,7 @@ export class LoginPage extends BasePage {

async visit(): Promise<void> {
await this.page.goto('/');
await this.page.waitForURL('http://localhost:8090/**');
await this.waitForPageLoad();
}

Expand Down
2 changes: 1 addition & 1 deletion e2e-tests/pages/ParticipantCreatePage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class ParticipantCreatePage extends BasePage {
}

async fillParticipantForm({ name, surname, birthDate, sex }) {
await this.nameInput.fill(name);
await this.nameInput.fill(`${ name } ${ surname }`);
await this.surnameInput.fill(surname);
await this.selectDate(birthDate);
await this.selectSex(sex);
Expand Down
2 changes: 1 addition & 1 deletion e2e-tests/pages/ParticipantsTab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ export class ParticipantsTab extends BasePage {
await this.page.getByTestId('experiment-participant-add-button').click();
await this.page.getByLabel('Participant').click();
await this.page.locator(`div[role="option"]:has-text("${ participantName }")`).first().click();
await this.page.getByRole('dialog').getByRole('button', { name: 'Add' }).click();
await this.page.getByRole('dialog').getByRole('button', { name: 'Assign to experiment' }).click();
}
}
26 changes: 10 additions & 16 deletions e2e-tests/pages/RecordingsTab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,21 @@ export class RecordingsTab extends BasePage {
await this.page.getByRole('tab', { name: 'Recordings' }).click();
}

async addRecording({ scenarioExecutionName, activityExecutionName, name, description, link, channel, participant }): Promise<void> {
await this.page.getByRole('button', { name: 'Create' }).click();

async addRecording({ scenarioExecutionName, activityExecutionName, name, description, filePath, channel, participant }): Promise<void> {
await this.page.getByRole('button', { name: 'Create New Recording' }).click();
await this.page.getByLabel('Scenario Executions').click();
await this.page.locator('div[role="option"]').filter({ hasText: scenarioExecutionName }).first().click();

await this.page.getByRole('option', { name: scenarioExecutionName }).click();
await this.page.getByLabel('Activity Execution').click();
await this.page.locator('div[role="option"]').filter({ hasText: activityExecutionName }).first().click();

await this.page.getByRole('option', { name: activityExecutionName }).click();
await this.page.getByLabel('Name').click();
await this.page.getByLabel('Name').fill(name);

await this.page.getByLabel('Description').click();
await this.page.getByLabel('Description').fill(description);

await this.page.getByLabel('Link').fill(link);

await this.page.getByLabel('Channel').click();
await this.page.locator('div[role="option"]').filter({ hasText: channel }).first().click();

await this.page.getByRole('option', { name: channel }).click();
await this.page.getByLabel('Participants').click();
await this.page.locator('div[role="option"]').filter({ hasText: participant }).first().click();

await this.page.getByRole('button', { name: 'Create' }).click();
await this.page.getByRole('option', { name: participant }).click();
await this.page.getByRole('button', { name: 'Create Recording' }).click();
await this.page.waitForURL('/experiments/**');
}
}
3 changes: 2 additions & 1 deletion e2e-tests/pages/RegistrationPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import { BasePage } from './BasePage';
export class RegistrationPage extends BasePage {
async visit(): Promise<void> {
await this.page.goto('/');
await this.createAccountButton.click();
await this.page.waitForLoadState('networkidle');
await this.page.getByRole('link', { name: 'Create Account' }).click();
await this.waitForPageLoad();
}

Expand Down
16 changes: 16 additions & 0 deletions e2e-tests/pages/ScenariosExecutionsTab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,20 @@ export class ScenariosExecutionsTab extends BasePage {
await this.page.locator(`div[role="option"]:has-text("${ participantName }")`).first().click();
await this.page.getByRole('button', { name: 'Update' }).click();
}

async useTimeSeriesForAnyParticipant({ scenarioExecution, activityExecution }): Promise<void> {
await this.visit();
await this.waitForPageLoad();
await this.page.getByRole('button').filter({ hasText: scenarioExecution }).first().click();
await this.page.getByText(activityExecution).first().click();
await this.page.getByRole('button', { name: 'Time Series' }).click();
}

async useAnyTimeSeriesView(): Promise<void> {
await this.visit();
await this.waitForPageLoad();
await this.page.locator('[test-data="scenario-execution-title"]').first().click();
await this.page.locator('[test-title-data="activity-execution-title"]').first().click();
await this.page.getByRole('button', { name: 'Time Series' }).click();
}
}
16 changes: 9 additions & 7 deletions e2e-tests/pages/TimeSeriesCreatePage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,17 @@
// });

import { BasePage } from './BasePage';
import { Locator } from '@playwright/test';
import { expect, Locator } from '@playwright/test';

export class TimeSeriesCreatePage extends BasePage {
async visit(): Promise<void> {
await this.page.goto('/experiments/67d6ff5e3075786c4f00bc00/activity-executions/67d7025913cc6dc06528d475/participants/67d6fdc14a5301c720455c97/time-series');
await this.page.goto('/experiments/67d6ff5e3075786c4f00bc00/activity-executions/67d7025913cc6dc06528d475/participants/67d6fdc14a5301c720455c97/time-series/create');
await this.waitForPageLoad();
}

async openForm(): Promise<void> {
await this.page.getByRole('button', { name: 'Create New Time Series' }).click();
}

private get linkInput(): Locator {
return this.page.getByLabel('Link', { exact: true });
}
Expand Down Expand Up @@ -103,11 +105,11 @@ export class TimeSeriesCreatePage extends BasePage {
}

private get createButton(): Locator {
return this.page.getByRole('button', { name: 'Create' });
return this.page.getByRole('button', { name: 'Create time series' });
}

async fillForm({ link, type, spacing, measure, recording, channel, modality, liveActivity }): Promise<void> {
await this.linkInput.fill(link);
async fillForm({ filePath, type, spacing, measure, recording, channel, modality, liveActivity }): Promise<void> {
await this.page.getByLabel('File input').setInputFiles(filePath);
await this.selectType(type);
await this.selectSpacing(spacing);
await this.selectMeasure(measure);
Expand All @@ -119,6 +121,6 @@ export class TimeSeriesCreatePage extends BasePage {

async submitForm() {
await this.createButton.click();
await this.page.waitForURL('/experiments/67d6ff5e3075786c4f00bc00/activity-executions/67d7025913cc6dc06528d475/participants/67d6fdc14a5301c720455c97/time-series');
await this.page.waitForURL('/experiments/**');
}
}
1 change: 1 addition & 0 deletions e2e-tests/test-files/audio_sample.wav
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Sample audio data for testing
4 changes: 4 additions & 0 deletions e2e-tests/test-files/data_sample.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
timestamp,value,channel
2024-01-01 10:00:00,1.23,Audio
2024-01-01 10:00:01,2.34,Audio
2024-01-01 10:00:02,3.45,Audio
1 change: 1 addition & 0 deletions e2e-tests/test-files/text_sample.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This is a sample text file for testing file uploads in the recording form.
1 change: 1 addition & 0 deletions e2e-tests/test-files/video_sample.mp4
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Sample video data for testing
Loading