Skip to content

Issue266 - automated test for view test report for gradle project#470

Open
SuparnaSuresh wants to merge 31 commits intoOpenLiberty:mainfrom
SuparnaSuresh:issue266_AutomatedTestForViewTestReport
Open

Issue266 - automated test for view test report for gradle project#470
SuparnaSuresh wants to merge 31 commits intoOpenLiberty:mainfrom
SuparnaSuresh:issue266_AutomatedTestForViewTestReport

Conversation

@SuparnaSuresh
Copy link
Contributor

Fixes #266
Automated test case for View test report is enabled for gradle project.

@aparnamichael
Copy link
Contributor

@SuparnaSuresh
Merge the latest changes from the main branch into this branch. The fixes for Linux build failures are available in the main branch.

@SuparnaSuresh
Copy link
Contributor Author

Updated the branch. Thanks

@SuparnaSuresh SuparnaSuresh self-assigned this Jan 27, 2025
await utils.delay(1000);
console.log("Tabs opened: " + tabs.indexOf(constants.GRADLE_TEST_REPORT_TITLE));

expect(tabs.indexOf(constants.GRADLE_TEST_REPORT_TITLE) > -1, "Gradle test report not found").to.equal(true);
Copy link
Contributor

@aparnamichael aparnamichael Jan 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of checking for tab count > -1, can we close all the other tabs and open only the reports and check the tab header title?

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);
  expect (tabs[0], "Gradle test report not found").to.equal(constants.GRADLE_TEST_REPORT_TITLE);
}).timeout(60000);

Also good to add an assert statement, if 'tabs' is empty.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed. Thanks

Copy link
Contributor

@aparnamichael aparnamichael left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update the assert condition in test for more reliable result.

@SuparnaSuresh
Copy link
Contributor Author

Incorporated review comments. Thanks.

@aparnamichael aparnamichael self-requested a review January 31, 2025 10:06
aparnamichael
aparnamichael previously approved these changes Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

View Test Report test failing for gradle

2 participants