public function testStatusPresenceOK() { reset_webservice(); $this->set_api_key('PNG123'); $elements = self::$driver->findElement(WebDriverBy::id('tiny-compress-status'))->findElements(WebDriverBy::tagName('p')); $statuses = array_map('innerText', $elements); $this->assertContains('API connection successful', $statuses); $this->assertContains('You have made 0 compressions this month.', $statuses); }
public function tearDown() { clear_settings(); clear_uploads(); reset_webservice(); }
public function testShouldShowSavings() { reset_webservice(); $this->set_api_key('PNG123'); $this->upload_image(dirname(__FILE__) . '/../fixtures/input-example.png'); self::$driver->get(wordpress('/wp-admin/options-media.php')); self::$driver->wait(2)->until(WebDriverExpectedCondition::presenceOfElementLocated(WebDriverBy::cssSelector('#tiny-compress-savings p'))); $elements = self::$driver->findElement(WebDriverBy::id('tiny-compress-savings'))->findElements(WebDriverBy::tagName('p')); $statuses = array_map('innerText', $elements); $this->assertContains('You have saved a total of 53.0 kB on images!', $statuses); }