<commit_before># $Id$
package EnsEMBL::Selenium::Test::Location;
use strict;
use base 'EnsEMBL::Selenium::Test::Species';
use Test::More; 

__PACKAGE__->set_default('timeout', 50000);
#------------------------------------------------------------------------------
# Ensembl Location link test
# Can add more cases or extend the existing test cases
#------------------------------------------------------------------------------
sub test_location {
  my ($self) = @_;
  my $sel    = $self->sel;
  my $SD     = $self->get_species_def;
  my $sp_bio_name = $SD->get_config($self->species,'SPECIES_BIO_NAME'); 

  $self->open_species_homepage($self->species,undef, $sp_bio_name);  
  my $location_text = $SD->get_config(ucfirst($self->species), 'SAMPLE_DATA')->{LOCATION_TEXT};

  if($location_text) {
    $sel->ensembl_click_links(["link=Example region"]);
    my @location_array = split(/\:/,$location_text);
    $sel->ensembl_is_text_present($SD->thousandify(@location_array[1]))
    and $sel->ensembl_is_text_present("Region in detail");
#    and $sel->ensembl_images_loaded;

    $sel->ensembl_click("link=Configure this page") and $sel->ensembl_wait_for_ajax_ok(undef,4000);

    #turn ncRNA track on/off(only for the species having ncrna tracks)
     if($sel->is_text_present("ncRNA(")){
      $sel->ensembl_click("modal_bg");
      
      $self->turn_track("ncRNA", "//form[\@id='location_viewbottom_configuration']/div[4]/div/ul/li", "on");
      $self->turn_track("ncRNA", "//form[\@id='location_viewbottom_configuration']/div[4]/div/ul/li", "off");      
      #next;
    } else {
      print "  No ncRNA Tracks \n";
      $sel->ensembl_click("modal_bg");
    }

    #Test ZMENU (only for human)
    if(lc($self->species) eq 'homo_sapiens') {
      #Searching and adding decipher track
      $self->turn_track("Variation","//form[\@id='location_viewbottom_configuration']/div[5]/div[7]/div/ul[2]/li", "on", "decipher");
      
      #simulate ZMenu for this track (decipher)
      $sel->pause(5000); #pausing a bit to make sure the location panel loads fine from adding the track<commit_msg>fix decipher xpath<commit_after># $Id$
package EnsEMBL::Selenium::Test::Location;
use strict;
use base 'EnsEMBL::Selenium::Test::Species';
use Test::More; 

__PACKAGE__->set_default('timeout', 50000);
#------------------------------------------------------------------------------
# Ensembl Location link test
# Can add more cases or extend the existing test cases
#------------------------------------------------------------------------------
sub test_location {
  my ($self) = @_;
  my $sel    = $self->sel;
  my $SD     = $self->get_species_def;
  my $sp_bio_name = $SD->get_config($self->species,'SPECIES_BIO_NAME'); 

  $self->open_species_homepage($self->species,undef, $sp_bio_name);  
  my $location_text = $SD->get_config(ucfirst($self->species), 'SAMPLE_DATA')->{LOCATION_TEXT};

  if($location_text) {
    $sel->ensembl_click_links(["link=Example region"]);
    my @location_array = split(/\:/,$location_text);
    $sel->ensembl_is_text_present($SD->thousandify(@location_array[1]))
    and $sel->ensembl_is_text_present("Region in detail");
#    and $sel->ensembl_images_loaded;

    $sel->ensembl_click("link=Configure this page") and $sel->ensembl_wait_for_ajax_ok(undef,4000);

    #turn ncRNA track on/off(only for the species having ncrna tracks)
     if($sel->is_text_present("ncRNA(")){
      $sel->ensembl_click("modal_bg");
      
      $self->turn_track("ncRNA", "//form[\@id='location_viewbottom_configuration']/div[4]/div/ul/li", "on");
      $self->turn_track("ncRNA", "//form[\@id='location_viewbottom_configuration']/div[4]/div/ul/li", "off");      
      #next;
    } else {
      print "  No ncRNA Tracks \n";
      $sel->ensembl_click("modal_bg");
    }

    #Test ZMENU (only for human)
    if(lc($self->species) eq 'homo_sapiens') {
      #Searching and adding decipher track
      $self->turn_track("Variation","//form[\@id='location_viewbottom_configuration']/div[5]/div[7]/div/ul[3]/li", "on", "decipher");
      
      #simulate ZMenu for this track (decipher)
      $sel->pause(5000); #pausing a bit to make sure the location panel loads fine from adding the track
{'fraction_non_alphanumeric': 0.2310073827101691, 'fraction_numerical': 0.00904977375565611, 'mean_word_length': 3.0737148399612026, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 53, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5994658', 'n_tokens_mistral': 1445, 'n_tokens_neox': 1372, 'n_words': 257}