Skip to content

Conversation

@StCyr
Copy link
Contributor

@StCyr StCyr commented May 13, 2022

Fixes #31952

Signed-off-by: Cyrille Bollu [email protected]

@StCyr StCyr added enhancement 3. to review Waiting for reviews ux labels May 13, 2022
@StCyr StCyr requested review from PVince81 and jancborchardt May 13, 2022 06:56
@StCyr StCyr self-assigned this May 13, 2022
Copy link
Member

@PVince81 PVince81 left a comment

Choose a reason for hiding this comment

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

👍 thanks!

@PVince81 PVince81 requested a review from nimishavijay May 13, 2022 06:59
@PVince81
Copy link
Member

/rebase

@StCyr
Copy link
Contributor Author

StCyr commented May 29, 2022

No idea why drone fails

@PVince81
Copy link
Member

hmm, seems the test is expecting a specific message: https://github.com/nextcloud/server/blob/master/tests/acceptance/features/bootstrap/LoginPageContext.php#L69

I'd personally prefer to remove the message matching and rely only on classes.
If we do want to change the match, we'd need to separate the locator/selector because we use a different message now in the public link share page

@danxuliu is it common to expect specific messages like this in acceptance test ?

@danxuliu
Copy link
Member

The locators are already separated, the one that fails is in PublicShareContext.php, not in LoginPageContext.php :-)

Using specific messages should be fine if they are stable enough, although I would also favour relaying instead on CSS classes and things like that. However, in this case the text needs to be used because the other elements are not specific enough; the message just has a warning class, so removing the text would make the locator a bit brittle.

Having said that, rather than adjusting the text in the locator I think it would be OK to add an explicit class to the message (like wrong-password or something like that) and use it instead of the text in the locator.

@PVince81
Copy link
Member

@danxuliu thanks a lot for the info

@StCyr would you be able to fix the test ?

  1. find the message in
    return Locator::forThe()->xpath("//*[@class = 'warning' and normalize-space() = 'The password is wrong. Try again.']")->
  2. remove the message
  3. add a CSS class to the message
  4. change the locator to only use CSS (like it's done in the first part of https://github.com/nextcloud/server/blob/master/tests/acceptance/features/bootstrap/LoginPageContext.php#L69 )

To run acceptance tests locally:
% cd tests/acceptance
% ./run.sh features/app-files-sharing-link.feature:147

otherwise I can also take over 😄

… is wrong or has expired

Signed-off-by: Cyrille Bollu <[email protected]>
@StCyr
Copy link
Contributor Author

StCyr commented May 31, 2022

I think I did good @PVince81 ;-)

@danxuliu
Copy link
Member

I think I did good @PVince81 ;-)

Happy to see an xpath expression replaced with a pure CSS one :-)

But... :-) Please keep in mind that the equivalent CSS expression would have been .warning.wrongPasswordMsg, without a space between the classes, so both classes refer to the same element; right now the locator expression is the element with class wrongPasswordMsg that is a descendent of an element with class warning, rather than the element with classes warning and wrongPasswordMsg. It works anyway because the div is inside a fieldset element with a warning class. In any case I have no strong preference for the previous expression, so feel free to amend it or keep it as is :-)

And if you already knew all that... then sorry for the noise ;-)

@PVince81 PVince81 merged commit 0726271 into master Jun 1, 2022
@PVince81 PVince81 deleted the fix-31952 branch June 1, 2022 07:04
@PVince81
Copy link
Member

PVince81 commented Jun 1, 2022

let's move on. thanks a lot @StCyr and @danxuliu !

@PVince81 PVince81 added this to the Nextcloud 25 milestone Jun 1, 2022
@PVince81
Copy link
Member

PVince81 commented Jun 1, 2022

/backport to stable24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: UX issues when requesting share by mail password

6 participants