Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 27 commits into
base: main
Choose a base branch
from

Conversation

SuparnaSuresh
Copy link
Contributor

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

@@ -248,26 +235,28 @@ it('start gradle with docker from liberty dashboard', async () => {

}).timeout(350000);

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

@aparnamichael aparnamichael Jan 17, 2025

Choose a reason for hiding this comment

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

Fix the indentation.

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

@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.

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