We want to run selenium backed jwebunit tests from our hudson server. We have a couple of selenium rc servers already on our network which I'd like to reuse.
However, how can I configure jwebunit to use those servers as I would like to avoid installing a slenium rc server on the hudson. Building is already work enough without starting/stopping firefoxes.
Have you tried Selenium Grid and then you just point your tests at the Selenium Grid Hub and your tests never have to know where the Selenium Remote Control servers are.
https://github.com/SeleniumHQ/selenium/wiki/Grid2
Ok, as far as i can see it cannot be done immediately : it is hardcoded in the implementation.
public void beginAt(URL aInitialURL, TestContext aTestContext) throws TestingEngineResponseException {
this.setTestContext(aTestContext);
selenium = new DefaultSelenium("localhost", port, "*chrome", aInitialURL.toString());
selenium.start();
gotoPage(aInitialURL);
}
Related
I am new to Akka Framework and I am doing a POC on it.
Using Akka Http, I am trying to resolve a Http Request and return a response. But my query is how could we run this Akka application in a server environment. All the examples I could see is as look below.
public static void main(String[] args) throws Exception {
ActorSystem system = ActorSystem.create("userServer");
ActorRef userActor = system.actorOf(UserActor.props(), "userActor");
UserServer server = new UserServer(userActor);
server.startServer("localhost", 8080, system);
}
As per my understanding, this is we are running the application from a standalone file. But in an enterprise version we always intended to run an application through a Server.
So How possibly we could run the Akka application through server?
It’s not clear what you mean by “through server”. Do you mean a JEE server? There’s no need or benefit of doing anything like that.
Running in a production server or container typically just involves running from a command line the same way you are doing now. There are tools in both maven and sbt (and others) to help you with the details of packaging and containerizing.
...
$this->browse(function (Browser $browser) {
$browser->visit(url()->route('login'))
->type('email', 'user.one#email.com')
->type('password', 'something')
->press('Login')
->pause(60*60*1000)
->assertRouteIs('dashboard')
...
It works on local which is use APP_URL something like 'https://project.dev' but not work for remote 'https://project.com' and 'http://123.123.12.12'.
Errors or Problems
login test on remote site not work
Different between local and remote
dusk installed in local
dusk not installed in remote
What i did to try solve it
I read that Chrome need HTTPS. I given https to it. Still not work. 😫
I pause the dusk longer. With the dusk browser open, i try type the username & password and submit it. Still not work. 😫
Reported on laravel dusk github as well
Without exact errors, it is difficult, to answer your question,
but from what you described I can provide some hints:
You should never use dusk in production or public site, even if it's configured as dev (security concerns).
I assume, that you are trying to run dusk on your dev, with remote APP_URL. This is wrong concept, cause your tests can manipulate data on db. In case your local and remote uses the same database it might work, but as said, bringing further problems.
Considering above, some of your tests could pass, if you make sure the following requirements are satisfied:
your .env APP_URL matches in both locations
you don't use migrations,factories etc in your dusk tests
you don't write any data to db (via testing register page for example) cause it would be a nightmare to handle these changes, when using the same db and running tests for local and remote
you modify DuskTestCase.php to add --no-sandbox option. This speeds tests up - so you shouldn't need to use pause
Final thoughts.
A good workflow for this would be:
Test your app locally
Commit changes to VCS (Version Control System) with CI (Continuous Integration) - for example gitlab - and run dusk test there.
Deploy to production, if tests are passing, either manually, or via deploy scripts - CD (Continuous Delivery)
I recently added support for subscriptions via WebSockets to my React+Redux+ApolloGraphQL application. Since doing that I cannot run my unit tests anymore.
The problem I come up with is:
Unable to find native implementation, or alternative implementation for WebSocket!
It seems there is not an available implementation for WebSockets on the node environment where I run my tests.
There are a couple of proposed solutions in this bug report that involve using the 'ws' library for node but I cannot make them work. Either I cannot load the library properly, or I can but then the application doesn't work.
I was thinking of a way to load the library depending on the environment I'm on but:
I don't know how to do that
I don't know if it's the right approach.
Any suggestions?
How are you running your tests? In my case, I'm using Jest, so I've put inside setupTests file (which is executed before running all of your tests) this code:
import WebSocket from 'ws';
Object.assign(global, {
WebSocket,
});
This is necessary because for tests which aren't running in browser, there's no native Web Socket implementation.
I am using Selenium RC for website testing and I need to use multiple proxies at once and am doing this using: firefoxProfileTemplate when I start the selenium server. This, however, doesn't allow me to multi-thread selenium as each selenium object still uses the same firefoxProfileTemplate, and therefore the same proxy, (I am using Python to control / interact with selenium) as they all have the same proxy.
I am wondering if there is a way to specify the firefoxProfileTemplate when I launch the selenium object / open a web page with selenium rather than just when I launch the server. Alternatively, is there a way to run multiple instances of the selenium server and specify which one to interact with? Thanks for any advice.
Since Selenium Rc is the mechanism to start browser the only way to do what you want is with multiple rc instances. When starting it add -port #### and give your instances unique port numbers.
When you create a selenium object you do sel = Selenium('localhost', ####, '*firefox', 'http://foo.bar')
As a side note in Selenium 2 which is in alpha you can build all of this programatically since there is no reliance on RC.
PHPUnit works great, I love it actually, problem I'm having is that my hosting plan imposes a 30 second cap on the duration of a query. If PHPUnit tests take longer than that, the connection is closed by the server, and I never get to find out if all my tests passed or not.
Is there an existing automatic way of running an arbitrarily long test suite using AJAX to batch unit tests so that they'd never hit the 30s threshold? As long as each individual test takes less than 30s I think it should work.
Thanks
Why are you running the tests on the production server? Your tests are for running on your development server, to make sure your code is good before sending into production.
You may be able to change the default timeout with set_time_limit (link). That resets the time left to run whenever it's run.