Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(web): AddDrag interaction#2583

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
TurekBot wants to merge12 commits intoserenity-js:main
base:main
Choose a base branch
Loading
fromTurekBot:drag-interaction-attempt-1

Conversation

@TurekBot
Copy link
Contributor

Background

Jan was very gracious and told me precisely how I could accomplish this in#2132, and so despite my lack of experience with Typescript, Protractor, and WebdriverIO, I tried to add aDrag interaction.

Where it's at

I think it's close, but I'm not sure it's there yet.@jan-molak, if you have some time, please feel free to take a look.

At least one problem

In the gitpod, I tried runningnpm run test, but it's upset about something with Protractor. Here's the error it's giving me.

gitpod /workspace/serenity-js (drag-interaction-attempt-1) $ npm run test> serenity-js-monorepo@3.0.0-monorepo test> lerna run test --scope '@serenity-js/*'lerna notice cli v6.6.2lerna verb rootPath /workspace/serenity-jslerna notice filter including "@serenity-js/*"lerna info filter [ '@serenity-js/*' ]lerna verb run Nx target configuration was found. Task dependencies will be automatically included.    ✔  @serenity-js/core:compile  [local cache]    ✔  @integration/testing-tools:compile  [local cache]    ✔  @serenity-js/core:test  [local cache]    ✔  @serenity-js/cucumber:compile  [local cache]    ✔  @serenity-js/assertions:compile  [local cache]    ✔  @serenity-js/mocha:compile  [local cache]    ✔  @serenity-js/jasmine:compile  [local cache]    ✔  @serenity-js/console-reporter:compile  [local cache]    ✔  @serenity-js/cucumber:test  [local cache]    ✔  @serenity-js/rest:compile  [local cache]    ✔  @serenity-js/web:compile  [local cache]    ✔  @serenity-js/assertions:test  [local cache]    ✔  @serenity-js/mocha:test  [local cache]    ✔  @serenity-js/jasmine:test  [local cache]    ✔  @serenity-js/console-reporter:test  [local cache]    ✔  @serenity-js/local-server:compile  [local cache]    ✔  @serenity-js/serenity-bdd:compile  [local cache]    ✔  @serenity-js/rest:test  [local cache]    ✔  @serenity-js/web:test  [local cache]    ✔  @serenity-js/protractor:compile  [local cache]    ✔  @serenity-js/local-server:test  [local cache]    ✔  @serenity-js/serenity-bdd:test  [local cache]    ✖  @serenity-js/protractor:test       > @serenity-js/protractor@3.29.4 test       > c8 npm run test:no-coverage                     > @serenity-js/protractor@3.29.4 test:no-coverage       > protractor ./spec/protractor.conf.js              [07:20:16] I/launcher - Running 1 instances of WebDriver       [07:20:16] I/direct - Using ChromeDriver directly...       [07:20:16] E/runner - Unable to start a WebDriver session.       [07:20:16] E/launcher - Error: Error: ECONNREFUSED connect ECONNREFUSED 127.0.0.1:49611           at ClientRequest.<anonymous> (/workspace/serenity-js/packages/protractor/node_modules/protractor/node_modules/selenium-webdriver/http/index.js:238:15)           at ClientRequest.emit (node:events:519:28)           at ClientRequest.emit (node:domain:488:12)           at emitErrorEvent (node:_http_client:108:11)           at Socket.socketErrorListener (node:_http_client:511:5)           at Socket.emit (node:events:519:28)           at Socket.emit (node:domain:488:12)           at emitErrorNT (node:internal/streams/destroy:169:8)           at emitErrorCloseNT (node:internal/streams/destroy:128:3)           at processTicksAndRejections (node:internal/process/task_queues:82:21)       [07:20:16] E/launcher - Process exited with error code 100              =============================== Coverage summary ===============================       Statements   : Unknown% ( 0/0 )       Branches     : Unknown% ( 0/0 )       Functions    : Unknown% ( 0/0 )       Lines        : Unknown% ( 0/0 )       ================================================================================           ✔  @serenity-js/webdriverio:compile (8s) ————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— >  Lerna (powered by Nx)   Ran target test for 12 projects and 13 tasks they depend on (9s)     ✔    23/24 succeeded [22 read from cache]     ✖    1/24 targets failed, including the following:         - @serenity-js/protractor:test

@jan-molak
Copy link
Member

Great work,@TurekBot! I love that you've written the API docs too, much appreciated 🙇🏻

One suggestion: three integration tests inweb-specs /PageElement.spec.ts are failing forPlaywright,Protractor, andWebdriverIO because of how detecting the invocation location is affected by changes to import statements: if we add more imports or reformat them, the line number of where the activity is instantiated changes, and so you'll need to update the assertions inPageElement.spec.ts.

Other than that I think this PR is good to go!

@jan-molakjan-molak self-assigned thisOct 13, 2024
I borrowed the drag and drop example html from MDN. Conveniently, it logs all the drag events.Related tickets:serenity-js#2132
Once implemented, this will allow you to drag elements to other elements.Related tickets:serenity-js#2132
I based it loosely off the `Switch` interactionRelated tickets:serenity-js#2132
I have no experience with Protractor. However, this implementation is pretty close to the one Jan suggested inserenity-js#177, so maybe I got it right? Who knows.
I have no experience with WebdriverIO. However, other people in the bug ticketwebdriverio/webdriverio#8022, say this works, so maybe it does?
@TurekBotTurekBotforce-pushed thedrag-interaction-attempt-1 branch from8e8a1e1 to299ddb5CompareOctober 27, 2024 05:04
@TurekBot
Copy link
ContributorAuthor

TurekBot commentedOct 27, 2024
edited
Loading

I rebased my branch onto the upstream main and then removed the semi-colon and updated the invocation locations. We'll see if the tests pass.

(I also dropped the package-lock changes that gitpod added just from opening gitpod. Hopefully, that doesn't cause any problems.)

@TurekBot
Copy link
ContributorAuthor

After trying a few things and looking at myoriginal test run, it seems my ProtractordragToimplementationalso wasn't passing (in addition to the invocation location problems).

🤔

@TurekBot
Copy link
ContributorAuthor

TurekBot commentedOct 27, 2024
edited
Loading

Well, I'm not sure what's up—but I found some clues.

In the protractor dragAndDrop API reference, itsays

Mouse actions do not work on Chrome with the HTML5 Drag and Drop API due to a knownChromedriver issue

And that issue seems to be a duplicate ofthis one that's still open that could be the culprit.

It's mindboggling to me that this bug could still exist in Chromedriver... Are people just not dragging and dropping things? Haha.

There'sa monkeypatch that might unstick things. 🤷‍♂️

But I'm also curious if doing a workaroundlike our Webdriverio implementation does could work.

CC:@jan-molak (in case you didn't already get a notification).

@jan-molak
Copy link
Member

Hey@TurekBot and apologies for the late reply, I was on holiday with limited access to the Internet.

Mouse actions do not work on Chrome with the HTML5 Drag and Drop API due to a knownChromedriver issue

Wow, this bug is 10 years old...

There'sa monkeypatch that might unstick things. 🤷‍♂️

The monkey patch seems pretty clever, but it's also 9 years old... I wonder if it still works 🤔

But I'm also curious if doing a workaroundlike our Webdriverio implementation does could work.

Would you mind checking? It feels like using the standard Webdriver action APIs should be a more stable solution than relying on patching the browser.

Also, thanks a million for investigating how to make drag'n'drop work consistently across all the drivers!

@jan-molakjan-molak removed their assignmentNov 3, 2024
@jan-molak
Copy link
Member

jan-molak commentedNov 16, 2024
edited
Loading

Hey@TurekBot - I noticed that ChromeDriver 130 no longer supports certain Protractor/Selenium 3 APIs (see#2612)
I updated Serenity/JS mono-repo to use Chrome and ChromeDriver 129 for the Protractor integration tests and examples. I've also modified the installation scripts so that they download a local version of both Chrome and ChromeDriver and don't rely on any globally installed browsers.

Please give me a shout if you'd like any help with this PR.

@jan-molak
Copy link
Member

@TurekBot - I updated your branch with the latest changes frommain -#2663

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

Reviewers

@jan-molakjan-molakjan-molak left review comments

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@TurekBot@jan-molak

[8]ページ先頭

©2009-2025 Movatter.jp