diff --git a/app/views/install/compose.phtml b/app/views/install/compose.phtml index 9a2669fb5c..e3ca65fa97 100644 --- a/app/views/install/compose.phtml +++ b/app/views/install/compose.phtml @@ -859,7 +859,7 @@ $image = $this->getParam('image', ''); - _APP_ASSISTANT_OPENAI_API_KEY appwrite-browser: - image: appwrite/browser:0.3.1 + image: appwrite/browser:0.3.2 container_name: appwrite-browser <<: *x-logging restart: unless-stopped diff --git a/docker-compose.yml b/docker-compose.yml index ede1011af3..32e81ea5e3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -958,7 +958,7 @@ services: appwrite-browser: container_name: appwrite-browser - image: appwrite/browser:0.3.1 + image: appwrite/browser:0.3.2 networks: - appwrite diff --git a/tests/e2e/Services/Avatars/AvatarsBase.php b/tests/e2e/Services/Avatars/AvatarsBase.php index cc626be99a..aca3af6dfa 100644 --- a/tests/e2e/Services/Avatars/AvatarsBase.php +++ b/tests/e2e/Services/Avatars/AvatarsBase.php @@ -1293,4 +1293,32 @@ trait AvatarsBase return []; } + + public function testGetScreenshotComparison(): array + { + /** + * Test screenshot comparison with stable domain (example.com) + * This test captures a screenshot of example.com and compares it + * against a reference image to ensure consistent rendering. + */ + $response = $this->client->call(Client::METHOD_GET, '/avatars/screenshots', [ + 'x-appwrite-project' => $this->getProject()['$id'], + ], [ + 'url' => 'https://example.com', + 'width' => 800, + 'height' => 600, + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEquals('image/png', $response['headers']['content-type']); + $this->assertNotEmpty($response['body']); + + // Compare with reference screenshot + $referencePath = \realpath(__DIR__ . '/../../../resources/avatars'); + $referenceScreenshot = $referencePath . '/screenshot-example-com.png'; + $this->assertFileExists($referenceScreenshot, 'Reference example.com screenshot not found'); + $this->assertSamePixels($referenceScreenshot, $response['body']); + + return []; + } } diff --git a/tests/e2e/Services/Sites/SitesConsoleClientTest.php b/tests/e2e/Services/Sites/SitesConsoleClientTest.php index 227e36a50e..2b75402b25 100644 --- a/tests/e2e/Services/Sites/SitesConsoleClientTest.php +++ b/tests/e2e/Services/Sites/SitesConsoleClientTest.php @@ -74,8 +74,11 @@ class SitesConsoleClientTest extends Scope $this->assertGreaterThan(1, $file['headers']['content-length']); $this->assertEquals('image/png', $file['headers']['content-type']); - $screenshotHash = \md5($file['body']); - $this->assertNotEmpty($screenshotHash); + // Compare with reference screenshots + $referencePath = \realpath(__DIR__ . '/../../../resources/sites/static-themed'); + $referenceScreenshotLight = $referencePath . '/screenshot-light.png'; + $this->assertFileExists($referenceScreenshotLight, 'Reference light screenshot not found'); + $this->assertSamePixels($referenceScreenshotLight, $file['body']); $screenshotId = $deployment['body']['screenshotDark']; $file = $this->client->call(Client::METHOD_GET, "/storage/buckets/screenshots/files/$screenshotId/view?project=console", array_merge($this->getHeaders(), [ @@ -87,10 +90,9 @@ class SitesConsoleClientTest extends Scope $this->assertGreaterThan(1, $file['headers']['content-length']); $this->assertEquals('image/png', $file['headers']['content-type']); - $screenshotDarkHash = \md5($file['body']); - $this->assertNotEmpty($screenshotDarkHash); - - $this->assertNotEquals($screenshotDarkHash, $screenshotHash); + $referenceScreenshotDark = $referencePath . '/screenshot-dark.png'; + $this->assertFileExists($referenceScreenshotDark, 'Reference dark screenshot not found'); + $this->assertSamePixels($referenceScreenshotDark, $file['body']); $screenshotId = $deployment['body']['screenshotLight']; $file = $this->client->call(Client::METHOD_GET, "/storage/buckets/screenshots/files/$screenshotId/view?project=console"); diff --git a/tests/resources/avatars/screenshot-example-com.png b/tests/resources/avatars/screenshot-example-com.png new file mode 100644 index 0000000000..2f8af920e0 Binary files /dev/null and b/tests/resources/avatars/screenshot-example-com.png differ diff --git a/tests/resources/sites/static-themed/index.html b/tests/resources/sites/static-themed/index.html index 955696b473..f1a446612f 100644 --- a/tests/resources/sites/static-themed/index.html +++ b/tests/resources/sites/static-themed/index.html @@ -5,19 +5,70 @@ Themed website - + +
+

Themed website

+

Adaptive light and dark mode showcase

+
Appwrite Sites
+
+ diff --git a/tests/resources/sites/static-themed/screenshot-dark.png b/tests/resources/sites/static-themed/screenshot-dark.png new file mode 100644 index 0000000000..199a09b902 Binary files /dev/null and b/tests/resources/sites/static-themed/screenshot-dark.png differ diff --git a/tests/resources/sites/static-themed/screenshot-light.png b/tests/resources/sites/static-themed/screenshot-light.png new file mode 100644 index 0000000000..4eae73c5b7 Binary files /dev/null and b/tests/resources/sites/static-themed/screenshot-light.png differ