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

[tests-only]added tests for public link share with expiration date #8527

Merged
merged 1 commit into from
Apr 9, 2021

Conversation

swoichha
Copy link
Contributor

Description

This PR adds tests for sharing file with expiration dateusing public link.

Related Issue

#8501

@swoichha swoichha force-pushed the test-expiration-date-public-share branch from 92f1aca to 64c8aad Compare April 1, 2021 07:29
@swoichha swoichha requested review from SwikritiT and dpakach April 1, 2021 11:06
@swoichha swoichha self-assigned this Apr 1, 2021
@swoichha swoichha marked this pull request as ready for review April 1, 2021 11:06
Copy link
Contributor

@SwikritiT SwikritiT left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@swoichha swoichha requested a review from individual-it April 7, 2021 03:12
Copy link
Member

@individual-it individual-it left a comment

Choose a reason for hiding this comment

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

the error output in the log is not so nice
Detail Exception: Step execution through test middleware failed. Error: AssertionError [ERR_ASSERTION]: Expiry Date Mismatch: [object Object]

but I guess that needs to be changed in the middleware

And the user edits the public link named "Public link" of file "textfile0.txt" changing following
| expireDate | 2038-07-21 |
Then the fields of the last public link share response of user "Alice" should include on the server
| expireDate | 2038-07-21 |
Copy link
Member

Choose a reason for hiding this comment

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

that step fails for me with

AssertionError [ERR_ASSERTION]: Expiry Date Mismatch: [object Object]
    at Object.assertUserLastPublicShareDetails (/home/artur/www/owncloud-test-middleware/src/helpers/sharingHelper.js:431:16)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async /home/artur/www/owncloud-test-middleware/src/app.js:56:7 {
  generatedMessage: false,
  code: 'ERR_ASSERTION',
  actual: '2038-02-07',
  expected: '2038-07-21',
  operator: 'strictEqual'
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Did you run the test after removing the snooze(5) step?

Copy link
Member

Choose a reason for hiding this comment

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

the problem seems to be my location settings. my date format is set to "d/m/yy" yours seems to be "m/d/yy"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will it be a problem in future if we run tests on CI?

Copy link
Member

Choose a reason for hiding this comment

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

we need a way to set the env. variable LC_TIME=en_US.utf8 before starting the app under test to make sure its always the same in all test runs

Copy link
Member

Choose a reason for hiding this comment

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

I've fixed the branch, now the tests work for me. I had to set the env. variable in test/gui/envvars these are the variables that get passed on to the AUT see https://kb.froglogic.com/squish/howto/specifying-environment-variables-application/

Copy link
Contributor

Choose a reason for hiding this comment

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

the problem seems to be my location settings. my date format is set to "d/m/yy" yours seems to be "m/d/yy"

related to #8367 ?

Copy link
Member

Choose a reason for hiding this comment

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

no, my system is set to Australian date format, and I believe @swoichha is set to US, so the app behaives correctly, I just had to adjust the app under test

if row[0] == 'expireDate':
expDate = row[1].split("-")

doubleClick(waitForObject(names.oCC_ShareLinkWidget_qt_spinbox_lineedit_QLineEdit), 5, 9, Qt.NoModifier, Qt.LeftButton)
Copy link
Member

Choose a reason for hiding this comment

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

this doubleclick seems not to be needed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The doubleClick is needed because we can only update the expiration date value by double clicking and selecting the current date and then typing the new value to replace the old value of dates.

Copy link
Member

Choose a reason for hiding this comment

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

hmm when I try it manually I even need to triple click to select the complete date

@swoichha swoichha force-pushed the test-expiration-date-public-share branch from c881050 to 4412955 Compare April 8, 2021 05:31
@swoichha swoichha requested a review from individual-it April 8, 2021 05:31
Copy link
Member

@individual-it individual-it left a comment

Choose a reason for hiding this comment

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

please rebase and squash the commits

@swoichha swoichha force-pushed the test-expiration-date-public-share branch from 3bddc9f to ac8b5f0 Compare April 8, 2021 10:41
author swoichha <[email protected]> 1616749467 +0545
committer swoichha <[email protected]> 1617878403 +0545

[tests-only]added tests for public link share with expiration date
@swoichha swoichha force-pushed the test-expiration-date-public-share branch from ac8b5f0 to 6e5df69 Compare April 9, 2021 05:02
@sonarqubecloud
Copy link

sonarqubecloud bot commented Apr 9, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@individual-it individual-it merged commit 281ac1d into master Apr 9, 2021
@delete-merged-branch delete-merged-branch bot deleted the test-expiration-date-public-share branch April 9, 2021 05:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants