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

Using request-html for Cross Device flow within the integration test #265

Open
peppelinux opened this issue Sep 6, 2024 · 4 comments · May be fixed by #294
Open

Using request-html for Cross Device flow within the integration test #265

peppelinux opened this issue Sep 6, 2024 · 4 comments · May be fixed by #294
Labels
enhancement Something improving existing features
Milestone

Comments

@peppelinux
Copy link
Member

we may use this library to test js execution

https://pypi.org/project/requests-html/

@peppelinux peppelinux added the enhancement Something improving existing features label Sep 6, 2024
@peppelinux
Copy link
Member Author

@peppelinux peppelinux added this to the 0.9.1 milestone Sep 6, 2024
@Zicchio
Copy link
Collaborator

Zicchio commented Sep 6, 2024

Expanding the issue for the readers of the future, which might need some amount of context to understand where this issue emerged.

The current design of the cross device integration test has very limited capabilities regarding the behaviour of the javascript running in the QRcode page.
In particular we need to verify the following minimumm requirements:

  1. the status endpoint (invoked by by a polling js) yields the correct status code across the different authentication steps;
  2. after the authentication flow is completed, the page must be updated to display a button which leads the user to the redirect uri

At the moment of writing this post, step (1) is done by parsing the html page scouting for the js variable which holds the status endpoint (which is plain dirty); step (2) is not done at all.

@peppelinux
Copy link
Member Author

playwrite seems to be better
https://github.com/microsoft/playwright-python

@Zicchio
Copy link
Collaborator

Zicchio commented Oct 30, 2024

playwrite seems to be better https://github.com/microsoft/playwright-python

It appears that this approach is promising.

Will follow with a pull request when the test is compplete.

Note that some isssues already emerged. For example if I'm not mistaken this does not work

<button href=""
class="btn btn-outline-primary"
aria-haspopup="false"
aria-expanded="false"
data-focus-mouse="false"
>

as href is not a valid attribute for tag <button>, see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button

@Zicchio Zicchio linked a pull request Oct 30, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Something improving existing features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants