Why ng e2e builds modules? - selenium

I used selenium webdriver before, in custom build project. It just opened web page of my project right away and immediately started running test cases. The only prerequisite was to start project server before launching it.
Now after creating generic project using 'ng new' I started it with 'ng serve'. Then I ran 'ng e2e' to test UI. It works, but for some reason it goes through whole module building thing again. It takes some time while I would like tests to start as fast as possible, and I know from my experience that it can be done.
The question: Can module building phase of ng e2e be omitted?

with the angular 6 and on --no-serve is not available anymore, so use instead:
ng e2e "--dev-server-target="
(yes empty value after the '=')
this will work if you have another window running an ng serve command.

Try with --no-serve option
ng e2e --no-serve

Related

Should be Cypress testing framework be installed separate from the testee project?

I have a big web project with a separate backend and a front-end (webpack). I'm going to use Cypress to create end-to-end tests.
What is not clear is where I should add the Cypress tests and Cypress itself. The documentation says to add it right to the testee project and it shows how to run the tests on the production website (which URL is different from the local, dev project). This means that I'm not able to run the tests on the development project because Cypress testing IDE and the testee project can't be run simultaneously because they share the same terminal.
If so, the best solution is probably to organize one more project, only for testing purposes, and having only Cypress installed and tests themselves? Is it a good practice and if so, which project should it be?
We have the same setup at work. We include the Cypress folder in the front-end repo. I'd agree with keeping it right next to the project because you have access to that code easily i.e. accessing utility functions, selectors, etc. As far as the terminal issue, you should be able to run your project locally in one terminal tab and the cypress test runner in another.

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.

jenkins selenium tests ci

I have created a Jenkins maven task to run selenium tests on one project, and now I want to use these selenium test in a proper way for CI.
Actually, I have a Jenkins task which 1-builds the project, 2- uses sonar, 3 - deploys the project. I would like to add the selenium tests to this process. The question is: can I run the selenium tests before deployment? Is it necessary to do a previous deploy for the selenium tests before the real deployment? Is there anyway to simulate a deployment or something like that so I can run the selenium tests?I would appreciate If you could advise me on how to do or any plugin which could help me.
As per my understanding, To deal with the scenario you should run the selenium test on QA environment. If all test pass then deployment should start for staging etc.
Additionally, once the deployment is done on staging, then selenium script should run again, test staging and if something went wrong then rollback from staging should be happened.
I never tried it but you can use below github plug-in for deployment(in case you are using github) :-
https://wiki.jenkins.io/display/JENKINS/GitHub+plugin
If you are using SVN then use below :-
https://www.packtpub.com/mapt/book/application_development/9781783553471/3
Hope it will help you :)

Setting up Protractor e2e tests with Bamboo CI

We use Protractor to automate our angular app and now need to run those protractor tests from a Bamboo CI server.
I'm new to Bamboo and was wondering if anybody could either show me how to or point me to a web article that would show me how to trigger/execute my protractor tests from Bamboo server.
Locally, we run the tests using gulp protractor which all run and pass; Now I'd like to execute those same tests from a Bamboo server.
I was only able to find some articles on Google that shows how to set up Selenium with Bamboo. I understand that Protractor uses Selenium under the hood but am just not sure if Protractor would follow the same steps as Selenium does, when setting it up on a Bamboo CI machine.
If Protractor follows a different setup than Selenium on a Bamboo CI machine, could someone please point me to either another article or simply show the steps here if it's simple to do.
This question is already a few months old, but it's still unanswered, so I try to help. ;)
I haven't tried it by myself, but there is a gulp task in bamboo. (as also mentioned here: gulp tasks execution in bamboo)
I think you have to install node.js on you bamboo server and then you can just add the gulp task to your plan and configure it for your needs.
Short field description:
Node.js executable: should be filled if you have installed Node.js on your bamboo server, or select the correct one if you have installed multiple versions of Node.js (I haven't installed Node.js, so there is no executable available for me)
Gulp executable: I'm not so femiliar with gulp, but I think this default value should be correct in the most cases.
Task: In your case you should insert protractor here

How to Serve an Aurelia.io app without using Gulp watch

How do you run an Aurelia app without running gulp watch and just going to localhost:9000. Ideally I would like to just run my nodejs server and it all just works without having to run a separate task (a gulp task).
I would like to build Aurelia and just start using it in the same way that I can with Durandal.
take a look at the Aurelia-Node Repo for a quick start. It uses ExpressJS to provide a simple REST api as well as static serve the Aurelia App.
You'd still need the Gulp task (inside public/app) to build your es6 modules etc. but the hosting then works from node itself, so gulp build should be enough.
EDIT:
The repo provides a gulpfile in the root as well. The big difference using this one is that it not only transpiles the frontend code but also browserSyncs the node application via nodemon. Again all of this is not necessary for final hosting. A normal node app.js would be enough. Gulp etc. is just used during the development process.
I download Aurelia repository from
https://github.com/aurelia/
And run project successfully via webstrom on different port not on localhost:9000 without "gulp watch" .
But I installed Aurelia dependency then started project on webstorm its run successfully.
Steps for run project without "gulp watch"...
Run given command on command line from project folder.
Install the Apps dependencies - **npm install**
Install JSPM dependencies - **jspm install -y**
Install Gulp - **npm install gulp**
then explore your index.html page on chrome. Make sure you running Aurelia in Chrome, IE and Firefox.
I tested Aurelia application in Chrome, IE , Safari and Firefox result
Chrome - Pass
IE - Pass
Firefox - Pass
Safari - Fail
But in safari that was fail.