Closed mKabouri closed 11 months ago
@mKabouri - I promise I haven't forgotten about this. This weekend I'll take a look. Btw, v42 or latest is a lot more stable to develop on, so if you come up, you'll have a less bad time now
Might have to still build, I still need to figure out where electron-chromedriver and pnpm are putting things in binary
@mKabouri - Am I correct that you're trying to improve tooling for format authors?
I love the intent behind this. However, this is what you'll need to do to get what you want:
getTestCodeFromIDAndFormat
. Just gut the bits you need for this. If you want to be super clean, you can make the old function use it, but no pressure. This will be what does the work in the backend to get the info and return it.packages/side-api/commands/outputFormats/getTestCodeFromIDAndFormat.ts
. Add this to side-api so that you can call await window.sideAPI.outputFormats.getTestCodeFromIDAndFormat(test.id, format.name)
or whatever. Follow a file pattern like commands/projects/getActive.ts
, and also make sure that you make index.ts files in side-api to hoist everything here similarly.@mKabouri - I should explain, the side-api package is a weird and kinda ugly abstraction, but I wanted a utility package for plugin authors so they would have the entire shape of the api without having to install electron as a dev package.
@toddtarsi I tried this but the Project editor just turning. Is there another alternative, for example using ipcRenderer and ipcMain ?
@mKabouri - Doing it this way is worth it. Commit what you have and I'll help.
@mKabouri - I'll take a look in about 6 hours and commit or PR some of the work to your branch, depending on the access I have.
@mKabouri - I'm sorry, I'm a bit too tired tonight. I'm going to try to look at this tomorrow. You're on the right track with the side-api additions!
@mKabouri - I think you need to supply some state for export format as well. You might be better off coming at this from a menu / hotkey angle so that format iteration and selection is solved (example here: https://github.com/SeleniumHQ/selenium-ide/blob/acf86928d1c9950b9c60d320cf0c1bcbb996a736/packages/selenium-ide/src/main/session/controllers/Menu/menus/suiteManager.ts).
This might sound shady, but I'm starting to work on a paid plugin that will basically "supercharge" (buzzword I'm sorry) export format development and playback as well, so while I'm supportive of any effort to democratize and add good code-export features and tooling, I'm planning to solve some of these DX problems to a pretty extreme degree via a cheap plugin.
Oh, I tried it out last night! But yeah, it seems a little too incomplete right now.
I console.log test.id in the browser side it always prints '-1' in the console, and test is imported from side-api. I don't know if this is the problem because when I create a new test it has also an id of '-1'.
@mKabouri - Can I see a reference to a line of code for what you're experiencing?
@mKabouri - Said differently, can you show me how you're always getting -1?
In the line before window.sideAPI.get....("language", test.id). I just console log console.log("Debug: ", test.id);
. I got 'Debug: -1'
This is a PR for #1673 issue. Thank you @toddtarsi.