Changeset 7280


Ignore:
Timestamp:
04/28/10 08:02:31 (2 years ago)
Author:
MichaelTempest
Message:

Item1326: Cancel the edit to avoid an "Are you sure you want to navigate away from this page?" popup from the next selenium-based test that tries to use the browser.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/WysiwygPlugin/test/unit/WysiwygPlugin/BrowserTranslatorTests.pm

    r7247 r7280  
    5959 
    6060 
    61  
    6261my $editFrameLocator = "css=iframe#topic_ifr"; 
    6362my $wikitextLocator = "css=a#topic_hide"; 
    6463my $wysiwygLocator = "css=input#topic_2WYSIWYG"; 
    6564my $editTextareaLocator = "css=textarea#topic"; 
     65my $editCancelButtonLocator = "css=input#cancel"; 
    6666 
    6767# This must match the text in foswiki_tiny.js 
     
    9797 
    9898    $this->{BrowserTranslator_Init}->{$this->{browser}} = 1; 
     99} 
     100 
     101sub DESTROY 
     102{ 
     103    my $this = shift; 
     104    for my $browser (keys %{ $this->{BrowserTranslator_Init} }) { 
     105        $this->{browser} = $browser; 
     106        $this->{selenium} = $this->{seleniumBrowsers}->{$browser}; 
     107 
     108        $this->_select_top_frame(); 
     109        $this->{selenium}->click( $editCancelButtonLocator ); 
     110    } 
     111    if (keys %{ $this->{BrowserTranslator_Init} }) { 
     112        $this->{selenium}->pause(); # Breathe for a moment; let TMCE settle before doing anything else 
     113    } 
     114    $this->SUPER::DESTROY if $this->can('SUPER::DESTROY'); 
    99115} 
    100116 
Note: See TracChangeset for help on using the changeset viewer.