-
Notifications
You must be signed in to change notification settings - Fork 25
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
Support for Nodejs Jasmine Tests #4
Comments
Hi Raghav, Thank you for writing. It was a pleasure to meet you. To develop the plug-in, I will need a little more help since I am not a JS developer. I have like basic knowledge of JS. So, can you give me detailed instructions on what I need to install on my machine and how to run the examples you supplied? Can you also tell me more about your use case- how many tests do you have and what your setup is. In Meissa, we need a way to get all tests from your files? Maybe we can parse them or is there a better way? In C# and Java, we use reflection to extract all test methods that we later supply to native test runners. Anton |
You need to install latest nodejs from https://nodejs.org. Then open command prompt in test directory and run below command. Now to run tests, Jasmine identifies the tests by spec file names. In https://github.com/angular/protractor/blob/master/example/conf.js : line 15, we provide the file names as a list. All the it blocks (lines between 2-10) in https://github.com/angular/protractor/blob/master/example/example_spec.js are treated as tests. In jasmine, we can not run the tests within a spec file in parallel. Multiple spec files can be run in parallel. In Meissa, you can treat each spec file as a test. If you clone example_spec.js as example_spec.1js, example_spec2.js etc and show me how to run these spec files in parallel, it would be helpful. Thanks, |
Do you need any clarifications? |
Thank you for the detailed info. Sorry for not writing immediately, was traveling for a two weeks and didn't have internet most of the time. I will find time during the weekend to work on that and will give you an update if I don't understand something. Have a nice day! |
Thank you.. |
Okay, I managed to setup and execute the tests. Read a bit Protractor and Jasmine docs but have a few questions. Anton |
To filter spec using protractor, you need to use --grep option. But it will be treated as a regular expression and all matching specs will be executed. grep will be consider name of describe and it. The goal you mentioned is correct. I have attached code files updated to generate NUnit test results. Notice the changes in conf.js file, reading spec name from environment variable if provided. When you collect multiple files, to run tests in a given file. Set the SPECS environment variable to file name and then run tests. ex : set SPECS='example_spec2.js' I am available for a skype call in detail if required. Thanks, |
Sorry, for not writing immediately, for some reason I didn't receive email notifications. Guess they have some bug here. Anyhow, I will check now your instructions and will write after. Thanks, |
Okay, I managed to executed the tests and save them to NUnit.xml results file. But not quite sure how to use the filter option. Can you give an example how to execute 1 of these 3 specs? Is there a way to fully specify the names- like suite.specName so that some test not to be executed twice. About ex command: Maybe will be easier to talk on skype, mine is - withfullspeed Thanks |
Just execute below command.. There is no way to specify suite.specName.. Same you can achieve by setting the SPECS like above to filter files and then using grep option to filter spec in the spec file. Try this, we can have Skype if this does not work. |
Hey man, Yesterday, I finished the plugin. Now released a beta version. You can try it from here. You need to use the new testTechnology=Protractor A few other things you need to know- do not manually install the NUnit Jasmin reporter, the plugin installed it in the temp conf.js files. For library path- you need to point the path to your conf.js file. As we talked, I didn't include the protractor folder in the plugins since you may want to install other dependencies. So, for everything to work, you need to make all installations in the Meissa\Plugins folder (node_modules) with the latest updated version of Protractor. The plugin gets the path to protractor as a relative path starting from the Plugins folder. I wrote the merge logic for test result files as good as I could considering the simple example tests files. I tested it, and it should work. But, you are the man to tell me 100% if it is working as expected. Keep in mind that it is best if the tests names (it) are unique since in the tests report there are not IDs, I update them based on these names. Please try it and tell me if everything is OK. When you confirm I will move the release to productions since now, I marked it as beta. Feel free to drop me a line in Skype if you prefer. Best, |
@mmraghavendra Did you have the chance to test the new plugin? Or you are still travelling? :) |
Sorry for the late reply. I have downloaded the latest beta zip file. I am able to start server and agent, but not getting how to execute tests. Can you please provide detailed steps? |
Okay, maybe I didn't explain well enough in the first message. Second try. A few things need to be done before you can start the Meissa agent.
meissa.exe runner --resultsFilePath="D:\protractor-tests\mergedResult.xml" --outputFilesLocation="D:\protractor-tests" --agentTag="TestAgent" --testTechnology="Protractor" --testLibraryPath="D:\protractor-tests\conf.js" --testServerUrl="http://127.0.0.1:5000" outputFilesLocations - all tests and other JS related files are here If you want distributed run, you have to start Meissa agent on two separate machines and repeat the operation with the installation of protractor. At the end of the run, you will have all test results merged into the file mergedResult.xml |
attached dump file Copying C:\Users\testuser\AppData\Local\Temp\11d4e8e4-55b1-4d7a-aae6-81b14b |
We are working on UI automation using Protractor ( https://www.protractortest.org ). We use Jasmine ( https://jasmine.github.io/setup/nodejs.html ) as our test runner.
We could make use of Meissa for test execution if you could add support. I met you in Selenium Conference 2018 and discussed the same with you.
Below is example of simple protractor test using Jasmine.
https://github.com/angular/protractor/tree/master/example
Please let me know if you need more info.
Thanks,
Raghav
The text was updated successfully, but these errors were encountered: