Skip to content

Commit

Permalink
Fix some UI tests (#17449)
Browse files Browse the repository at this point in the history
* improve seo test

* fix map

* update expected ui files
  • Loading branch information
sgiehl committed Apr 12, 2021
1 parent 0e6a6ea commit 41b8240
Show file tree
Hide file tree
Showing 13 changed files with 26 additions and 28 deletions.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 4 additions & 6 deletions plugins/SEO/tests/Integration/SEOTest.php
Expand Up @@ -9,6 +9,7 @@
namespace Piwik\Plugins\SEO\tests\Integration;

use Piwik\DataTable\Renderer;
use Piwik\Piwik;
use Piwik\Plugins\SEO\API;
use Exception;
use Piwik\Tests\Framework\Mock\FakeAccess;
Expand Down Expand Up @@ -46,16 +47,13 @@ public function setUp(): void
*/
public function test_API()
{
try {
$dataTable = API::getInstance()->getRank('http://www.microsoft.com/');
} catch(Exception $e) {
$this->markTestSkipped('A SEO http request failed, Skipping this test for now. Error was: '.$e->getMessage());
}
$dataTable = API::getInstance()->getRank('http://www.microsoft.com/');
$renderer = Renderer::factory('json');
$renderer->setTable($dataTable);
$ranks = json_decode($renderer->render(), true);
foreach ($ranks as $rank) {
if ($rank["id"] == "alexa") { // alexa is broken at the moment
if ($rank['rank'] == Piwik::translate('General_Error')) {
$this->markTestSkipped('An exception raised when fetching data. Skipping this test for now.');
continue;
}
$this->assertNotEmpty($rank['rank'], $rank['id'] . ' expected non-zero rank, got [' . $rank['rank'] . ']');
Expand Down
2 changes: 1 addition & 1 deletion plugins/UserCountryMap/svg/world.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion plugins/UsersManager/tests/UI/UsersManager_spec.js
Expand Up @@ -309,7 +309,7 @@ describe("UsersManager", function () {

expect(await page.screenshotSelector('.usersManager')).to.matchImage({
imageName: 'permissions_bulk_access_set',
comparisonThreshold: 0.02
comparisonThreshold: 0.025
});
});

Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 41b8240

Please sign in to comment.