I'm trying to use webdriverio with the jasmine test framework. I can run my test by typing jasmine at the command line. However, when I do wdio wdio.conf.js it opens a bunch of extra browsers which don't do anything. I'm just wondering what the point of the wdio.conf.js file is when I can just run jasmine at the commandline. Ultimately it's the same thing, right? However, I can't get the wdio.conf.js file to work in the same manner so it's useless to me. Perhaps I'm not managing the browser clients correctly but I don't see any guidelines on how this is commonly done. I read the documentation but it's pretty vague beyond auto-generating the wdio.conf file so that 'everything just works'. Am I supposed to use grunt or gulp to run my tests or are those tools separate from the wdio.conf idea?
I'm Just trying to get my head around all these different tools. All I need to do is make multiple automated tests to test a website. Thanks for your help.
This may help, https://github.com/webdriverio/webdriverio/blob/master/examples/standalone/webdriverio.with.jasmine.spec.js
I asked a similar question, which was answered by the main contributor here, Running WebdriverIO 'spec' tests as node file
Related
Intro
We struggle to setup cypress in the CI runners of gitlab.com. We use the default blueprint from vue-cli to scaffold the project. We tried various of different gitlab.yml configurations. Currently we run out of CI minutes because we tried so many different combinations.
We tried different docker images (from here: https://github.com/cypress-io/cypress-docker-images/) and also followed the best practices from Crypress which we found here: https://gitlab.com/cypress-io/cypress-example-docker-gitlab/
We just had no luck getting it running. After spending hours of hours we are not sure if it's even possible to get Cypress running with the default setup from vue-cli.
We also created an issue on vue repo but it got closed, for reference you can see here: https://github.com/vuejs/vue/issues/10944
We filled out the default vue template for an issue report but since it's not a real "JavaScript" issue it was hard to properly fill it out. But we tried to provide as much information as possible. In the codepen you find our results. The HTML column is the output and the JS column is the YML file. I hope you can use this information somehow
Version
2.6.10
Reproduction link
https://codepen.io/usamahamed/pen/WNbpdPE
Steps to reproduce
this this the gitlab CI pipeline result including in codepen
it give this
CypressError: cy.visit() failed trying to load:
We failed looking for this file at the path:
/builds/room/web/room-ui/
Checking your .yaml file, I think your application is not running.
There is not log of application running
There is no build stage implementation
There is no start application task on the stage test-e2e > before_script
So I would like to suggest:
Check your build stage. Where you make your application start running?
Check your before_script, adding a step "npm ci" like this:
https://gitlab.com/cypress-io/cypress-example-docker-gitlab/blob/master/.gitlab-ci.yml
or
https://github.com/cypress-io/cypress-example-kitchensink/blob/master/.gitlab-ci.yml
You should also wait for your application to be running to start testing. You can use the wait-on module for this: https://github.com/jeffbski/wait-on
I am having a small issue with WebStorm that I am hoping someone has experienced and solved before.
I am using WebStorm to build a angular.js app and I have it set up to use Karma to run my tests. This is fine for the most part: I have a Karma configuration setup and I can get to to run the tests or debug them with no issue.
My problem is that when I try to run a test individually by clicking on one of the test in the "Test Run" tree it goes off to a node configuration, tries to run it and fails (because its looking for js dependencies). After that I just go back to my 'karma config' and it runs through the whole of the test no problem.
Does anyone know how I can get the IDE hooked up so that I can trigger my tests from the UI?
Running tests from file right-click menu is only supported for those runners that allow executing individual tests (JSTestDriver, for example). There is currently no such possibility for Karma (WEB-13173). See the discussion at https://github.com/karma-runner/karma/issues/1235.
to run individual test files, you can have several karma configuration files with different sets of tests included. Plus you can rename individual tests/suits in the way mentioned in https://github.com/karma-runner/karma/issues/553
I upgraded to the latest TypeScript recently and have found that the JavaScript is no longer being generated in Visual Studio (2013) if there are any TypeScript type errors. Is there a way to tell TypeScript to ignore type errors? I'm cleaning up a project and would like to work my way through it incrementally.
This might not be the answer you are looking for, but it is the best for your scenario in my opinion: I think you'd be better off using a task runner (such as gulp, grunt, etc) that watches your files and compiles on the fly. It will ignore the IDE and do what you want it to do.
If you're using Visual Studio 2013, you can first install Task Runner. This allows you to run them inside a window in your IDE.
Then you'll want to setup your project using the given task runner of your choice and creating a task for it. Ted Patrick has an example using gulp here. Depending on the size of your project you might want to use TypeScript's incremental compilation features too.
I use that setup in VS13 and I couldn't be happier. Every time I save a TS file it is recompiled (regardless if it's considered valid by the IDE or not) and I see the errors right there. You can see what it looks like in this screenshot, and the VS13 project/task runner script is available on GitHub if you need a reference.
(If you don't want to be hassled with figuring out a task runner, the compiler (tsc.exe) has a -w command line argument that does all the watching too. You could just create a batch file that you fire once and run on the background.)
Even if VS13 has "native" ways to watch and compile a .ts file, I'd definitely recommend using something like this instead. It decouples your project from the IDE and gives you (or anyone else) the ability to easily compile your project from anywhere, as well as also use whatever other tasks you think are necessary when building the project.
I have spent hours trying to set up an automated testing environment for my AngularJS applications that I can run from Maven (capturing results in Bamboo)
A Google search reveals frameworks galore, based on Jasmine, Karma and generic JavaScript frameworks.
But for some reason the installation of these never goes as described.
Can anyone just point me to a set of downloads that I can install manually to proper directories, that will just execute my unit tests?
I asked a similar question previously and got down checked and requests to close. If you need to check me down, please leave a reason, as I am besides myself with frustration trying to solve this, and I am sure there many other developers experiencing the same issue
Testing javascript is not a totally mature thing, so there isn't a great diversity of good tools for doing so. Jasmine and Karma are the current best ways of doing that.
Those tools are best managed using bower, which is a nodejs package. So you'll have to install, in this order:
nodejs
npm (node package manager)
bower (using npm)
jasmine and karma using bower
phantomjs, and whatever other dependencies your javascript needs (presumably angular)
Then you can run the tests.
I found this package for maven with some brief googling, but god knows how to set it up:
http://searls.github.io/jasmine-maven-plugin/
There are many tutorials on going through this process. You have to accept that these are currently the best tools for doing this and give it your best shot. If you post more specific issues regarding the 'installation that never goes as described' of jasmine and karma you will get assistance.
you can use for example yeoman or angular-seed. both will require nodejs and optionally ruby. both will set you with phantomjs, jasmine, karma, bower and many more. however i would avoid combining that build with maven. imho it's far from perfect. java tools will never be as good as native js tools for building js project. if you really want to combine the builds then use java only to call nodejs and nothing more
I suppose I'm asking about what the proper procedure is.
I'm running Webstorm 7.0.3. I do not have node setup. I'm using the in place hosting on my local machine.
I have written unit tests, and can put a debug breakpoint in the test.js file. When I right-click and 'debug' my karma.conf.js file, it hits these breakpoints fine. Which is great for for basic stuff, but sometimes I need to go line by line inside a service.
Any breakpoints I place inside the service get skipped and ignored.
I have to assume this is is because karma is wrapping my actual script into some proxy file for execution.
How do I step through the service line by line? I feel like I missed something very obvious.
[Update]
#Eitan's comment was what i needed.
I assumed the karma task runner automatically wrapped all source up into the indecipherable un-debuggable non-sense. I never stopped to assume that putting the coverage pre-processor was responsible for it. Commenting the coverage reporter and pre-processor for karma-coverage now allows me to debug my unit tests from the karma chrome instance and from webstorm.
Are using the coverage reporter? It uses instrumented code so I guess you won't be able to debug your original file
You could launch chrome in your karma config and step through your service with dev-tools. I don't know if you can actually do it from within WebStorm because of the exact reason you mentioned (karma server). Just click the big DEBUG button on the upper right of the karma controlled chrome instance and open the scripts in dev-tools