Skip to content

Commit

Permalink
resolving conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
SuparnaSuresh committed Feb 17, 2025
1 parent 39c3ac7 commit 11b82ca
Showing 1 changed file with 25 additions and 18 deletions.
43 changes: 25 additions & 18 deletions src/test/GradleTestDevModeActions.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
import { assert, expect } from 'chai';
/**
* Copyright (c) 2023, 2025 IBM Corporation.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
*/
import { expect } from 'chai';
import { InputBox, Workbench,SideBarView, ViewSection,EditorView,DefaultTreeItem, DebugView } from 'vscode-extension-tester';
import * as utils from './utils/testUtils';
import * as constants from './definitions/constants';
import path = require('path');
import { viewTestReportForMac } from './utils/macUtils';

describe('Devmode action tests for Gradle Project', () => {
let sidebar: SideBarView;
Expand Down Expand Up @@ -185,22 +193,6 @@ it('start gradle with history from liberty dashboard', async () => {

}).timeout(350000);


it('View test report for gradle project', async () => {
// Close all the tabs in editor.
await new EditorView().closeAllEditors();
utils.delay(5000);
if ((process.platform === 'darwin')) {
//Function call to enter corresponding command in the command prompt to display test report for gradle project in mac
await viewTestReportForMac();
} else {
await utils.launchDashboardAction(item, constants.GRADLE_TR_DASHABOARD_ACTION, constants.GRADLE_TR_DASHABOARD_MAC_ACTION);
}
tabs = await new EditorView().getOpenEditorTitles();
await utils.delay(1000);
assert.equal(tabs[0], constants.GRADLE_TEST_REPORT_TITLE, 'Gradle test report not found');
}).timeout(60000);

/**
* All future test cases should be written before the test that attaches the debugger, as this will switch the UI to the debugger view.
* If, for any reason, a test case needs to be written after the debugger test, ensure that the UI is switched back to the explorer view before executing the subsequent tests.
Expand Down Expand Up @@ -254,6 +246,21 @@ it('attach debugger for gradle with custom parameter event', async () => {
expect(attachStatus).to.be.true;
}).timeout(550000);

it('View test report for gradle project', async () => {

if((process.platform === 'darwin' ) || (process.platform === 'win32') || (process.platform == 'linux'))
{
//skip running for platforms , enable once https://github.com/OpenLiberty/liberty-tools-vscode/issues/266 is resolved
return true;
}

await utils.launchDashboardAction(item,constants.GRADLE_TR_DASHABOARD_ACTION, constants.GRADLE_TR_DASHABOARD_MAC_ACTION);
tabs = await new EditorView().getOpenEditorTitles();
// expect (tabs[1]], "Gradle test report not found").to.equal(constants.GRADLE_TEST_REPORT_TITLE);
expect (tabs.indexOf(constants.GRADLE_TEST_REPORT_TITLE)>-1, "Gradle test report not found").to.equal(true);

}).timeout(30000);

// Based on the UI testing code, it sometimes selects the wrong command in "command palette", such as choosing "Liberty: Start ..." instead of "Liberty: Start" from the recent suggestions. This discrepancy occurs because we specifically need "Liberty: Start" at that moment.
// Now, clear the command history of the "command palette" to avoid receiving "recently used" suggestions. This action should be performed at the end of Gradle Project tests.
it('Clear Command Palatte', async () => {
Expand Down

0 comments on commit 11b82ca

Please sign in to comment.