Hybris starts server for unit tests - sap-commerce-cloud

I'm wondering why does Hybris start server for running unit tests.
I'm using hybris 1808 with telco accelerator 1810. I'm using command ant unittests.

You need to first initialize the junit tenant. Kindly open hac and check for the tenants. If Junit tenant is not there then add the following property to the local.properties and restart the server.
installed.tenants=junit
Then initialize the junit tenant.
Then the command ant unittests or ant allTests will work.

You don't have to start the server. In fact, you can skip the initialization of junit tenant as well if you are not using any data from the junit tenant i.e. if you are creating all the required data in the junit class itself.Sample
command for running junits :
ant unittests -Dtestclasses.extensions=basecommerce,core
More details.

Related

controller script running in studio or deployment

Is there a way in a groovy controller script to know is it's running in the studio or in deployment server?
I have code that will added data into the model for demo in studio mode while in deployment that data will come from a REST service call.
Yes there's an easy way to know if a Groovy script is running in authoring (preview) or in delivery (live). Crafter provides a global variable called modePreview. This variable is basically a boolean flag that indicates if the current environment is authoring, or in other words, if Crafter Engine is running in preview mode. So you can do something as simple as if (modePreview) { RUN CODE } in Groovy to run code that only needs to be run in the authoring environment.

Assign Build - Available builds is disabled in Microsoft Test Manager

I have created sample Coded UI Test in VS15 and checked in to the TFS15. Made a build definition using XAML and associate test there.
At MTM frount, I have ready environment with Test controller and agent. Plan and Test tasks are also completed in MTM Testing Center but When I move to Track in Assign Build to assign build I see Available builds drop down is disabled when i refresh i got below error message looking for help on this matter.
I am using Test Controller and Test Agent version 2013.
Application detected an unexpected fault.
Could not load type
'Microsoft.TeamFoundation.Build.WebApi.QueryDeletedOption' from
assembly 'Microsoft.TeamFoundation.Build2.WebApi, Version=14.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
Have u tried running MTM on a different machine, maybe your MTM installation was not succesful.
Try that and let me know.
Pablo

Browsers not visible when running Selenium2/Webdriver tests with Hudson

I am using Hudson CI to run an ant script which compiles and executes Selenium2/Webdriver tests (written as TestNG tests). These tests are set to run in a Firefox browser, not with headless HTMLUnit. During the Hudson build, I don't see any errors in the console output or the TestNG report, and my custom report seems to indicate that my tests do run normally, but I noticed that no actual Firefox browser is ever launched during the build.
In contrast, whenever I run my Selenium2/WebDriver tests via Eclipse or the command line either as a TestNG test or an Ant build, the tests always launch a browser on which I can see the tests being run. I just can't figure out why the browser does not appear. All of the aforementioned details suggest that the tests are in fact run properly, but the Hudson server is run on my local machine and no additional resources are apparently used to run the tests in their own Firefox instance.
I am not using Selenium Grid at the moment. Also, regardless if I run the tests sequentially or in parallel across multiple threads through Hudson, I am still not able to see any active browsers. I do vaguely remember at one point seeing Hudson launch an actual browser yesterday when I began this work, but I have yet to see once since. This makes me wonder if I possibly configured something incorrectly in my Hudson job.
Any help is greatly appreciated!
Login to test node
Open the window services and locate Jenkins Slave services
Right click and select properties
Go to “Log On” tab
Make sure option “Local System Account” is selected and tick the option “Allow service to interact with desktop”
Click OK to save the setting
Restart the services.

nUnit and Azure - How to start Dev Fabric from nUnit

I'm trying to create a worker process for Azure and I'd like to test it via nUnit. I need to write a process which connect to storage and uploads data to it. The problem is I can't find any references to how you actually set up the testing framework to start dev fabric etc.
I've created the Work Processor role and then created a testing project, wired up nunit to start and for the project to pick up the test project dll. This all works fine with nUnit opening, I'm able to see the test dll and run the test.
My issue is "How do I get the dev fabric to start up when running the project through nUnit?" I'm presuming that I need to put something into the setup routine within the test project but I can't see what I should put in.
If anyone has any tips, experience etc., links to how to etc. I'd be very grateful. I'm sure that I can't be the first person who want to put Azure projects under test.
Haven't done this myself, but the DevFabric (compute and store) has a command-line interface.
You would just invoke the commdn from your test stand-up routine and it should be good to go.
CSrun.exe is the command, please see MSDN for usage reference:
http://msdn.microsoft.com/en-us/library/gg433001.aspx

Coded UI Tests automation

I want to automate the process of running coded UI tests.
Do i need to have user logged in to the system?
Or is it possible to run it using XYNT service?
We are able to run our coded ui tests in an automated fashion using windows scheduler and the command line MSTest.exe. Take a look at the following MSDN article on how to accomplish this:
http://msdn.microsoft.com/en-us/library/ms182486.aspx
I believe you can use Microsoft's Test Manager to accomplish this as well but we don't have TFS (yet) so I can't vouch for it.
As far as I know, CodedUI Tests require an active desktop session, so running them under a service account without an open desktop session may work, but not without a session.
I used the mstest to run the coded ui test and use Windows TaskScheduler to schedule the test.
You can find detail in MSTest.exe command-line documentation.
When you want to run it automatically, there are two things you should pay attention:
1. Set auto log on
2. Close the screen saver
You need to take the snapshot of your enviroment with user logged in and then you can run your test through MS Test Manager or TFS (nightly build process)
Write the test's in Visual Studio 2010/2012, this means you can manually edit the test's the code, then you should run them in Test Manager,
BTW you need TFS and Test Manager to be the same year otherwise it won't work.
I've being doing a lot of these recently if you have any questions post it online and send me a message, I'll be happy to help.

Resources