SeleniumHQ / selenium-ide

Open Source record and playback test automation for the web.
https://selenium.dev/selenium-ide/
Apache License 2.0
2.78k stars 752 forks source link

Status: code export #592

Closed corevo closed 4 years ago

corevo commented 5 years ago

We've just started working on exporting to languages, we will continually update this thread with new information as it becomes available.

Languages:

We are aware that this feature is very important to the community, but we'd kindly ask to keep all conversation here, until a language is released and then any bug found should raise a ticket.

We would like to avoid splitting the same conversation into multiple threads.

rihp commented 5 years ago

Looking forward to the python version. Thanks for developing this tool

DrorCohenCC commented 5 years ago

Looking forward to the python version. Thanks for developing this tool

likewise! Python or Javascript would be greatly appreciated.

kevincvlam commented 5 years ago

+1, can't wait for python. Thanks for all the hard work!

jonesp100 commented 5 years ago

I'm just about to embark on a large suite of tests - how long do you think the export is going to be? As I dont want to commit to all these and have to move off to Katalon or some such? great work as always!!

tourdedave commented 5 years ago

@jonesp100 It depends on the language (since we're going in the order listed above, unless others are able to contribute as well), and even then it's hard to know since we're an open source project and timetables & competing priorities can be unpredictable for both contributors and maintainers -- so we can't publicly commit to a timeline.

If your objective is to run your tests cross-browser, in parallel, and/or on CI, then do be sure to check out the Selenium IDE command-line runner while you wait. Details available here.

jonesp100 commented 5 years ago

@tourdedave thanks for the response - appreciate you cant commit but do you have a rough timeline - first language - 1 month, 2 months....? Thanks!

zewa666 commented 5 years ago

Hey @corevo, just out of curiosity is it also planned to have a code import sort of thing along the export available. What I mean with that is once you export a code, and do minor modifications according to the style its exported, are you able to re-import it as a side project in Selenium IDE?

Moreover, with regards to the export behavior, do you plan to have a customizable export template per language or is it going to be a fixed set of definitions?

BaluErtl commented 5 years ago

What do you recommend, how would be the best to move forward the issue of exporting into PHP, please?

tourdedave commented 5 years ago

@jonesp100 ¯_(ツ)_/¯

@zewa666 No plans for code import at the moment. The initial MVP for code export will just be as-is -- not customizable.

@BaluErtl We're building code export so others can easily contribute other languages. PHP is a tricky one, though, since it's not an officially support language binding. Because of that it's unlikely we'd incorporate it into the mix. But we've discussed the option of making code export for additional languages available through plugins, which could be a nice option to make PHP available if someone wanted to contribute it.

zewa666 commented 5 years ago

@tourdedave having the code-export configurable via plugins would on the other hand also allow to customize the style of how things get exported. So besides Java then there could be an additional plugin to export to Java using 8 spaces, don't crucify me for that heretical example ;).

AdelSassi commented 5 years ago

Thanx a lot @corevo ! Looking forward for good news about junit export!

elinguiuriel commented 5 years ago

Looking forward to the python version. Thanks for developing this tool

Me to!

dstarke1245 commented 5 years ago

@tourdedave the .side files aren't affected by this, are they? So we can still edit our tests there.

and i am also really looking forward to this! :)

corevo commented 5 years ago

Yes, if you keep the .side files you can load them in to the IDE change them and re-export them.

hectormoreno87 commented 5 years ago

Great , waiting for C# exporting.

Thank you all.

NinaAnon commented 5 years ago

waiting for java exporting , thank you !

steffenkj commented 5 years ago

waiting for python export :)

sah-anshu commented 5 years ago

waiting for python export :) too.

vvccool commented 5 years ago

等待python导出

Sartek158 commented 5 years ago

Export to Java is great!

stebli commented 5 years ago

Why not allow users to specify their own export actions? Instead of hardcoding this in js files rather allow a config which can be modified to cater for different permutations of various frameworks.

so for a click i can opt to use a specific bit of code, specified in a text file for the click, instead of all these repetitive lines being exported. Just an idea... would then solve all "languages" issues as this would be abstracted and we can key/value pair the stuff.

sah-anshu commented 5 years ago

fyi- Just for confirmation, is export to Java Working?

tourdedave commented 5 years ago

@sah-anshu Yes, export is available for Java JUnit.

@stebli Code export is doing a lot more than just exporting individual commands. Allowing user customizations through a separate file isn't enough to solve for all languages -- especially if it puts the burden onto the user. But it's an interesting idea - thanks!

MisinformedDNA commented 5 years ago

@tourdedave @stebli I think this would be best solved by good guidance on how to create plugins to export code in different languages/test frameworks.

bcmoney commented 5 years ago

@tourdedave Is this being added to the Browser plugin/extension in the next release as well, or only via passing those parameters to the CLI tool?

Also, in case you didn't see my post on ide-77, since I saw how close you were getting with this, I've finally gotten around to writing a blog post about the "Durable Selector" approach our team has been using for several months now: http://bcmoney-mobiletv.com/blog/2019/04/27/selenium-ide-side-parser-for-durable-selectors/

Simply record ".side" format and import into our Java Test Suite, I think its a nice setup. Included a simple Maven project with the essentials, feel free to use it however you see fit!

stebli commented 5 years ago

@tourdedave @stebli I think this would be best solved by good guidance on how to create plugins to export code in different languages/test frameworks.

is this an option right now? Will it be limited to JS?

corevo commented 5 years ago

The plan is to allow 3rd party plugins to export code, we will be exporting to the official bindings, this way you could write a plugin to export to webdriver.io or such.

stebli commented 5 years ago

The plan is to allow 3rd party plugins to export code, we will be exporting to the official bindings, this way you could write a plugin to export to webdriver.io or such.

awesome. await that functionality....veery useful

upenk910 commented 5 years ago

Do anyone know when exporting to java will be fixed on the new selenium IDE

sah-anshu commented 5 years ago

Eagerly Waiting for Python Code Export.

tourdedave commented 5 years ago

@upenk910 What do you mean? Java export is available in the latest version (3.6.0).

upenk910 commented 5 years ago

i don't see the option can you tell me where is option to export in java the test case

On Wed, May 1, 2019, 7:10 AM Dave Haeffner notifications@github.com wrote:

@upenk910 https://github.com/upenk910 What do you mean? Java export is available in the latest version (3.6.0).

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/SeleniumHQ/selenium-ide/issues/592#issuecomment-488267533, or mute the thread https://github.com/notifications/unsubscribe-auth/AL6UVVIQHZYSPFUSNQWNF2LPTGCDDANCNFSM4G23OS3A .

rori4 commented 5 years ago

just right click on your test and there will be an export option. I have just exported one example test to java so I can confirm it is working image

upenk910 commented 5 years ago

Thanks, since to GUI of the selenium IDE has changed from the previous versions, i couldn't find it.

On Wed, May 1, 2019, 8:33 AM rori4 notifications@github.com wrote:

just right click on your test and there will be an export option. I have just exported one example test to java so I can confirm it is working [image: image] https://user-images.githubusercontent.com/22402693/57019320-cae7e000-6c2e-11e9-9235-23c969c15cd7.png

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/SeleniumHQ/selenium-ide/issues/592#issuecomment-488283117, or mute the thread https://github.com/notifications/unsubscribe-auth/AL6UVVKQKF6WFTBRVII4XWTPTGL2FANCNFSM4G23OS3A .

tourdedave commented 5 years ago

The docs have been updated to cover code export and include instructions for contribution a new language/framework.

https://www.seleniumhq.org/selenium-ide/docs/en/introduction/code-export/

stebli commented 5 years ago

The docs have been updated to cover code export and include instructions for contribution a new language/framework.

https://www.seleniumhq.org/selenium-ide/docs/en/introduction/code-export/

Hi tourdedave,

I followed these instructions but do not see the new item in the export list. Is this a complete guide? I see issues (i.e. missing aliases under code-export\node_modules\xxx) that arent mentioned in the guide if i just look at the folder structures.

tourdedave commented 5 years ago

To have it show up in the list you need to be sure to complete step 5. If you're getting build warnings then try cding into your package and running yarn build.

stebli commented 5 years ago

step 5

have done that yes...

yarn build yields

yarn build yarn run v1.16.0 $ babel -d dist src --ignore=test src/command.js -> dist/command.js src/hook.js -> dist/hook.js src/index.js -> dist/index.js src/location.js -> dist/location.js src/selection.js -> dist/selection.js ✨ Done in 0.92s.

when running yarn build:ext:prod from root i do see these warnings, could they be the issue?

WARNING in ./neo/stores/seed.js 17:496-509 "export 'CommandsArray' was not found in '../models/Command' @ ./neo/stores/seed.js @ ./neo/containers/Panel/index.jsx @ ./neo/containers/Root/index.jsx @ multi react-hot-loader/patch ./neo/containers/Root

WARNING in ./neo/stores/seed.js 17:535-548 "export 'CommandsArray' was not found in '../models/Command' @ ./neo/stores/seed.js @ ./neo/containers/Panel/index.jsx @ ./neo/containers/Root/index.jsx @ multi react-hot-loader/patch ./neo/containers/Root

tourdedave commented 5 years ago

No, those warnings are OK. Can you publish your fork and send a link?

stebli commented 5 years ago

Unfortunately not(did not fork) , company is locked down and we cant remote/upstream to github.

tourdedave commented 5 years ago

Can you create a gist with the contents of your selenium-ide/packages/code-export/src/index.js? The code export UI is built using the availableLanguages object in that file. That's the first place I'd look.

stebli commented 5 years ago

https://gist.github.com/stebli/81ef417e2ad4d41cf9f961cbdb52dab3

tourdedave commented 5 years ago

@stebli That looks correct.

Make sure that 1) you've added your package as a dependency in code-export (e.g., here) and 2) you're able to run yarn from the root of the project before building the extension (e.g., yarn build:ext:prod or yarn watch).

I've updated step 1 in the docs to include these bits.

stebli commented 5 years ago

Check on all fronts. Still no new export item. yarn build:ext:prod completes successfully with only the warnings listed above. I tried deleting the build folder and rebuilding/re-adding to chrome, no difference.

tourdedave commented 5 years ago

@stebli Can you open a new issue? It will be better to track the progress there.

stebli commented 5 years ago

@tourdedave https://github.com/SeleniumHQ/selenium-ide/issues/689 created.

tourdedave commented 5 years ago

\o/ Thanks!

tourdedave commented 5 years ago

I just submitted a PR for Python support (e.g., #719).

It will be available in the next release.

Screen Shot 2019-06-13 at 15 51 35
tourdedave commented 5 years ago

FYI - code export for Python was released yesterday.

e-omahony commented 5 years ago

@tourdedave, the python export is awesome, thanks to you and everyone else involved!