-
Notifications
You must be signed in to change notification settings - Fork 529
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4cd373c
commit 6944882
Showing
1 changed file
with
11 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)<[email protected]> | ||
// SPDX-License-Identifier: MPL-2.0 | ||
|
||
import path from "path"; | ||
|
||
import { AppType, launchApp } from "./launchApp"; | ||
import path from "path"; | ||
|
||
describe("menus", () => { | ||
const closeDataSourceDialogAfterAppLaunch = async (app: AppType) => { | ||
|
@@ -12,7 +11,7 @@ describe("menus", () => { | |
await expect(app.renderer.getByTestId("DataSourceDialog").isVisible()).resolves.toBe(false); | ||
}; | ||
|
||
it("when opening the rosbag file the data should be shown on the 3D panel", async () => { | ||
it("should open the rosbag file when dragging and dropping it", async () => { | ||
await using app = await launchApp(); | ||
await closeDataSourceDialogAfterAppLaunch(app); | ||
|
||
|
@@ -21,25 +20,18 @@ describe("menus", () => { | |
__dirname, | ||
"../../packages/suite-base/src/test/fixtures/example.bag", | ||
); | ||
|
||
//Expect that there are not preloaded files | ||
await expect( | ||
app.renderer.getByText("No data source", { exact: true }).innerText(), | ||
).resolves.toBe("No data source"); | ||
const fileInput = app.renderer.locator("[data-puppeteer-file-upload]"); | ||
await fileInput.setInputFiles(filePath); | ||
|
||
// wait until the elements are rendered | ||
await app.renderer.waitForTimeout(6000); | ||
|
||
//Click on play button | ||
const playButton = app.renderer.getByTitle("Play").nth(0); | ||
await playButton.click(); | ||
//Drag and drop file | ||
const fileInput= app.renderer.locator('[data-puppeteer-file-upload]'); | ||
await fileInput.setInputFiles(filePath); | ||
|
||
//Click on 3D panel | ||
const threeDeeSettingsIcon = app.renderer.getByTestId("SettingsIcon").nth(0); | ||
await threeDeeSettingsIcon.waitFor(); | ||
await threeDeeSettingsIcon.click(); | ||
// Verify if the file was loaded by searching on the left panel for the element contained on the file | ||
const textContent = app.renderer.locator('div[role="button"]').textContent(); | ||
expect(textContent).toContain("world"); | ||
}, 20_000); | ||
//Expect that the file is being shown | ||
await expect( | ||
Check failure on line 34 in desktop/integration-test/openFile.test.ts GitHub Actions / lint (ubuntu-20.04)
|
||
app.renderer.getByText("example.bag", { exact: true }).innerText(), | ||
).resolves.toBe("example.bag");}, 20_000); | ||
}); |