SeleniumHQ / selenium-ide

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

I have a problem to get textCode.body from exportTestToFormat method of OutputFormatsController #1673

Open mKabouri opened 1 year ago

mKabouri commented 1 year ago

I want to get textCode.body from exportTestToFormat method of OutputFormatsController. I created a new file:

var codeExport: string;

export function setCodeExport(newValue: string) {
    codeExport = newValue;
}

export function getCodeExport() {
    return codeExport;
}

I add setCodeExport(textCode.body) before return in exportTestToFormat method. After exporting a test in a language in selenium ide. I try to print with console.log getCodeExport() in another file. I always got undefined.

toddtarsi commented 1 year ago

@mKabouri - Oh shoot, I see that export broke a while back. It appears to be infinitely looping. Both my kids are sick and one had to go to the hospital yesterday, so I'll try and find time to fix tonight, but it might have to wait for the weekend. Sorry about that!

toddtarsi commented 1 year ago

@mKabouri - Please, give it a shot again on the latest version at your earliest convenience. Code-export should be repaired now. I accidentally had a case where it would compile forever until stack overflow, should be resolved now 😄

mKabouri commented 1 year ago

I still have the same problem. I can explain what I want to do more clearly. I have created a new component inside the browser folder, and I created a new file that contains the code above. In the other hand, I add in exportTestToFormat method just before return this line of code:

        setTextareaContent(testCode.body);

The idea is to display the test code in my component when I export the test in a given language.

toddtarsi commented 1 year ago

@mKabouri - Can you PR and I'll review from there? I am much more helpful looking at code than discussing it

mKabouri commented 1 year ago

@toddtarsi I have PR. Thank you for your time.

toddtarsi commented 12 months ago

@mKabouri - I understand now. Thank you for providing a code example. You want a code-export preview.

toddtarsi commented 12 months ago

@mKabouri - Okay, having looked, I think I explained your issue. Let me know if you'd like any clarification, and nice feature!