How can I automate phantomjs and casperjs tests in Karma - testing

I am trying to find a way to automate tests written in phantomjs &&/|| Casperjs with karma. Apparently you can run tests in phantomjs, but you cannot use phantomjs or casper as a framework/plugin like Jasmine. I know phantomjs in not a framework, but you can write tests with it. It is a bit confusing.
What I want to achieve is basically what you can do in Rails when you run Rspec. Is it possible? Am I using the wrong tools ?
Thanks!

Related

Call Cypress Test from TestCafe

One of the projects has automated several test cases in Cypress.
We are using TestCafe to Automate our test cases. We want to call some of the test written in Cypress from TestCafe.
These Cypress test create precondition data that we can use in TestCafe. These cypress test cases are complicated and perform bunch of actions. Also, it is not responsibility of our project to maintain those scenarios. So, there is no sense to automate these test again in Test Café. It will help us in reusing test cases. We tried various approaches
Schedule specific Pipeline in Cypress with those test cases. Trigger this Pipeline from TestCafe
Is there a better way to call specific Cypress test from TestCafe ?
To me, calling Cypress tests from TestCafe tests seems like less clean a way to do it.
I'd do it with pipelines as you hinted at in your question:
Run Cypress tests that set up what you need
If 1. succeeds, trigger TestCafe tests
This looks pretty straigforward to me, and it's perhaps what other people would expect as well, so you make lives of your colleagues easier :)

When i run a test in protractor instead of opening the given link in browser it gives error(please check image)

So when i execute a simple calculator program from VS- Studio and when the browser opens ...everytime it is same(plz refer image) tried lot but everytime same error. I followed lot of tutorial for protractor automation tool..no progress
You are running integration tests using karma
I am sure you are using ng test
Which will run integration test. I mean the spec file inside your component will be run using karma
Use ng e2e to run protractor tests.

Can You Bootstrap CasperJS Tests?

I bootstrap PhantomJS in my Selenium tests by using Phanbedder.
This downloads and extracts the correct version of PhantomJS to a temp dir and my Selenium tests then use this version.
Is there a similar bootstrapping option for CasperJS?
I am working in a Java project and I already call casper from Java using a process builder.
If you install CasperJS using NPM, it includes some PhantomJS version in its node_modules directory. This is likely an older version.
Otherwise, no (I'm not familiar with such a project).
How would that even work? CasperJS is directly built on top of PhantomJS. It runs in PhantomJS. So, you would have to have an additional script for downloading such a version.
You would have to implement it yourself. You can set the PHANTOMJS_EXECUTABLE environment variable to point to your intended PhantomJS executable.

How to automate export of Selenium IDE scripts into rspec

I have a QA person creating Selenium scripts inside Selenium IDE for Rails 3 app.
I am trying to find way to automate the export from Selenium IDE into rspec so they will be run automatically on our CI server. Basically, I don't want to manually export scripts from Selenium IDE. Has anyone done this or have suggestions on an approach?
Thanks.
-Matt
Yes, you can export your selenium test to rspec. But you need to install another firefox add on call php formatters.
When you had installed this add on your firefox, you can convert your selenium ide tests to rspec.

How to present a Selenium test written in spec or PHPUnit on Hudson

I am setting up Selenium tests on Hudson and looking for an easy way to present nice results such as Project summary and build summary on Hudson.
Currently I have written Selenium test cases in Rspec and PHPUnit's extension for Selenium (I prefer working on Rspec over PHP).
What is the best way to present detailed report for Selenium tests on Hudson CI Server?
I prefer to use Rspec over PHPUnit. It would be very nice if I can use rspec and still integrate well with Hudson CI Server.
I would very much appreciate for detailed comments.
thank you so much for your help
Best regards
If you have the results as HTML files, you can use the HTML Publisher plugin.
Have a look at a similar question https://serverfault.com/questions/184805/how-to-view-test-results-in-hudson/185027#185027 This guy seams to have integrated the selenium tests into junit and therefore the results can be published using the xunit tests.
There are two selenium plugins, one should work for you.
This I have no idea what rspec is I entered rspec and Hudson into google. The second link was this one http://reprocessed.org/blog/easy_rails_ci_with_hudson It should contain everything you need.