browse(function ($browser) { if ($browser->isPhone()) { $this->markTestSkipped(); } $browser->go('mail'); $browser->waitFor('#messagelist tbody tr:first-child') ->ctrlClick('#messagelist tbody tr:first-child'); $browser->clickToolbarMenuItem('more'); $browser->with(new Popupmenu('message-menu'), function ($browser) { $uids = $browser->driver->executeScript('return rcmail.message_list.get_selection()'); $this->assertCount(1, $uids); $this->assertTrue(is_int($uids[0]) && $uids[0] > 0); $uid = $uids[0]; list($current_window, $new_window) = $browser->openWindow(function ($browser) { $browser->clickMenuItem('extwin'); }); $browser->driver->switchTo()->window($new_window); $browser->with(new App(), function ($browser) use ($uid) { $browser->assertEnv([ 'task' => 'mail', 'action' => 'show', 'uid' => $uid, ]); // TODO: werify the toolbar, which is different here than in the preview frame }); $browser->driver->close(); $browser->driver->switchTo()->window($current_window); }); }); } }