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

Bug 1878591: Added tests for lso ocs disk inventory #6606

Merged

Conversation

afreen23
Copy link
Contributor

Screenshot from 2020-09-13 17-35-17
Signed-off-by: Afreen Rahman afrahman@redhat.com

@openshift-ci-robot openshift-ci-robot added component/lso Related to local-storage-operator-plugin approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Sep 14, 2020
@afreen23 afreen23 changed the title test: Added tests for lso ocs disk inventory Bug 1878591: Added tests for lso ocs disk inventory Sep 14, 2020
@openshift-ci-robot
Copy link
Contributor

@afreen23: This pull request references Bugzilla bug 1878591, which is invalid:

  • expected the bug to target the "4.6.0" release, but it targets "---" instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

Bug 1878591: Added tests for lso ocs disk inventory

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot openshift-ci-robot added bugzilla/severity-low Referenced Bugzilla bug's severity is low for the branch this PR is targeting. bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. labels Sep 14, 2020
@afreen23
Copy link
Contributor Author

/bugzilla refresh

@openshift-ci-robot
Copy link
Contributor

@afreen23: This pull request references Bugzilla bug 1878591, which is invalid:

  • expected the bug to target the "4.6.0" release, but it targets "---" instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

/bugzilla refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@afreen23
Copy link
Contributor Author

/bugzilla refresh

@openshift-ci-robot
Copy link
Contributor

@afreen23: This pull request references Bugzilla bug 1878591, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.6.0) matches configured target release for branch (4.6.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

/bugzilla refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot openshift-ci-robot added bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. and removed bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. labels Sep 14, 2020
await browser.get(`${appHost}/`);
await clickNavLink(['Compute', 'Nodes']);
await isLoaded();
$(`a[data-test-id="${nodeName}"]`).click();
Copy link
Contributor

Choose a reason for hiding this comment

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

All the selectors should be moved to a corresponding view.ts file, similar to other tests.

Copy link
Contributor Author

@afreen23 afreen23 Sep 14, 2020

Choose a reason for hiding this comment

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

This takes in a dynamic value therefore I avoided creating anon functions and it wont be reused anywhere else.

Comment on lines +58 to +63
expect(firstRow.get(2).getAttribute('innerText')).toBe(firstDisk.type || '-');
expect(firstRow.get(3).getAttribute('innerText')).toBe(firstDisk.model || '-');
Copy link
Contributor

Choose a reason for hiding this comment

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

getText also returns the visible inner text of the element. I am not sure why we would want to do it this way.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

getAttribute returns text for hidden elements and on certain screens few of the columns will be hidden

Copy link
Contributor

Choose a reason for hiding this comment

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

since it will be running headless if getText works on headless mode then let us keep it as getText

Copy link
Contributor Author

@afreen23 afreen23 Sep 14, 2020

Choose a reason for hiding this comment

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

getText , does not works therefore we are using getAttribute here.

Copy link
Contributor

Choose a reason for hiding this comment

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

https://github.com/openshift/console/pull/6606/files#diff-1e194e3ba92229ea049eea86f7bf2e94R47
If all the headers(columns) are visible I am confused why exactly some of the elements are missing here.

Copy link
Contributor Author

@afreen23 afreen23 Sep 18, 2020

Choose a reason for hiding this comment

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

for headers the presence of DOM node is checked by the attribute data-label=.
We are not using protractor get() and getText() functions which work on element type

Edit: And these functions work for visible elements and return empty string for hidden elements

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have posted the screenshot of running tests in description as well.
#6606 (comment)

await browser.get(`${appHost}/`);
await clickNavLink(['Compute', 'Nodes']);
await isLoaded();
click($(`a[data-test-id="${nodeName}"]`));
Copy link
Contributor

Choose a reason for hiding this comment

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

You can create a function and pass this dynamic value in view.ts file.
It will be useful, if the selectors get changed in future version.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

await textbox.sendKeys(discoveredDevices[0].path);
let updatedRows = resourceRows.count();
expect(updatedRows).toBe(1);
// info: clear() is not triggering event to clear the filter and update rows
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see clear method being called here. So I guess this comment can be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See the lines 71-72, its for that and its valid here.

Comment on lines +58 to +63
expect(firstRow.get(2).getAttribute('innerText')).toBe(firstDisk.type || '-');
expect(firstRow.get(3).getAttribute('innerText')).toBe(firstDisk.model || '-');
Copy link
Contributor

Choose a reason for hiding this comment

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

https://github.com/openshift/console/pull/6606/files#diff-1e194e3ba92229ea049eea86f7bf2e94R47
If all the headers(columns) are visible I am confused why exactly some of the elements are missing here.

Signed-off-by: Afreen Rahman <afrahman@redhat.com>
Copy link
Contributor

@bipuladh bipuladh left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Sep 18, 2020
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: afreen23, bipuladh

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit 460c2c3 into openshift:master Sep 18, 2020
@openshift-ci-robot
Copy link
Contributor

@afreen23: All pull requests linked via external trackers have merged:

Bugzilla bug 1878591 has been moved to the MODIFIED state.

In response to this:

Bug 1878591: Added tests for lso ocs disk inventory

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@spadgett spadgett added this to the v4.6 milestone Sep 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/severity-low Referenced Bugzilla bug's severity is low for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. component/lso Related to local-storage-operator-plugin lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants