Some selenium tests depend on each other. Example: controller_customer.t doesnt work, if controller_domain.t isnt executed beforehand. Common.pm is used so that selenium tests are more independent. Right now, it contains code to create a domain. Very useful for multithreading later on. Change-Id: If01c7cd4d17ef66771bc64516088d3f57b02bf78changes/22/28922/6
parent
0649dcb594
commit
0d1e5ead5b
@ -0,0 +1,28 @@
|
||||
package Selenium::Collection::Common;
|
||||
|
||||
use warnings;
|
||||
use strict;
|
||||
use Moo;
|
||||
|
||||
use Test::More import => [qw(diag ok is)];
|
||||
|
||||
has 'driver' => (
|
||||
is => 'ro'
|
||||
);
|
||||
|
||||
sub create_domain {
|
||||
my ($self, $name) = @_;
|
||||
return unless $name;
|
||||
|
||||
diag('Go to domains page');
|
||||
$self->driver->find_element('//*[@id="main-nav"]/li[5]/a')->click();
|
||||
$self->driver->find_element('//*[@id="main-nav"]/li[5]/ul/li[6]/a')->click();
|
||||
|
||||
diag('Try to add a domain');
|
||||
$self->driver->find_element('//*[@id="content"]/div/div[1]/span[2]/a')->click();
|
||||
ok($self->driver->wait_for_text('//*[@id="reselleridtable"]/tbody/tr[1]/td[2]', 'default'), "Default reseller and creation site are avalible");
|
||||
$self->driver->find_element('//*[@id="reselleridtable"]/tbody/tr[1]/td[5]/input')->click(); #select default reseller
|
||||
$self->driver->find_element('//*[@id="domain"]')->send_keys($name);
|
||||
$self->driver->find_element('//*[@id="save"]')->click();
|
||||
}
|
||||
1;
|
||||
Loading…
Reference in new issue