-
-
Notifications
You must be signed in to change notification settings - Fork 69
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
Add Cookie Handling, Fix Publish Date, and Update Element Selectors #88
base: main
Are you sure you want to change the base?
Add Cookie Handling, Fix Publish Date, and Update Element Selectors #88
Conversation
…ish date referred to issue Schrodinger-Hat#84. Changed text based element xpath to selectors because with different languages on browser it gets stuck. TODO: Change where possible full selector with wildcards
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for handling the cookie panel, it will solves a lot of issue I believe.
On the publish/confirm/days selectors: you are using some classes defined by the bundler, which will change at every spotify release.
We should avoid using those kind of classes.
Instead, since the issue may came from a different language set on the account, we should fix this by set at the start (when we are accepting the cookies) the english language.
I see there is this button here:
<button aria-label="Change language" data-encore-id="buttonSecondary" class="Button-sc-y0gtbx-0 jHYozi">
that will trigger the language modal then we can click on the data-testid="language-option-en"
selector which is relative to the english language.
Doing this will secure that the selectors containing the text()
functions will be always valid.
What do you think on this?
That would certainly solve the problem without having to change all the selectors, you are right. I'm getting back to text based xpath elements and forcing the language to be us using the button you suggested. Thank you, i didn't see that. Would have been easier too :D Going to fix that, VT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good on my side, did not try it locally: could you please attach the successful upload terminal log or a video in headless: false
mode? Thank you, great effort there
Yep, don't know where to upload the video so i'm dumping here the log for now.
If needed i can upload the video on yt as private or something like this? don't know which one is the best option here. VT |
@abe-101 @matevskial could you please review this? Thanks |
i've noticed that i missed to revert the xpath of save_as_draft button. Now should be all right |
Thank you for the contribution. I checked the code and I have some suggestions.
|
Thank you @matevskial for the review.
On the related discord channel i dropped a video with headless false too.
Never noticed this error instead when i've already accepted the cookie before the login. But here would be nice to test with other local envs and see if the behaviour is the same.
|
Thank you for the response. About point 1: Thank you for the elaboration, the language handling is definitely going to be useful, do it wholeheartedly :D About point 2: I think I now understand why the cookie popup appears for you, because you are located in an EU country. About point 3: My question to this point: you don't ever see the issue randomly appearing after you implement cookie popup handling in your local Mac env? About point 4: Do the refactor then :) |
about point 3: Nope i've never seen that error with the cookie handler implemented. about point 4: That's sure :D |
Okay, in that case, After you are done, I am going to implement the handling of my cookie popup :D. Because I also see the same issue that you try to fix with the cookie popup. I guess my cookie popup causes the same thing too? In that case, after you are done, I am going to implement cookie handling for my cookie popup too, |
Yep you can try, in your case you just need to click the X at the top right corner? Or need to interact with a popup like EU based cookie? Because we could add an env variable that uses my cookie handler or your cookie handler based on a boolean 'EUZONE' var |
Could you please rebase and verify if this is still applicable ? |
input[type=file]
failed: Waiting failed: 30000ms #87. This update allows the script to click on the cookieOption button, accept only the forcedCookies, and then proceed with the login process.TODO: Further improve selector usage by incorporating wildcards where appropriate for better code readability.
During the development process, @TheJoin95 and I discussed the possibility of using class-based elements or selector-based elements for referencing xPath elements. I considered using wildcards in the selectors to improve code readability, but I haven't implemented them yet due to uncertainty about whether to adopt selector-based or class-based elements. For now, I've kept it simple and used selectors without wildcards.
@abe-101, I'd appreciate your feedback on these changes and any suggestions you might have on whether to pursue selector-based or class-based elements for future updates.
VT