diff --git a/tests/kb-spec.js b/tests/kb-spec.js index 16446b8..955ca73 100644 --- a/tests/kb-spec.js +++ b/tests/kb-spec.js @@ -8,12 +8,43 @@ function getSpecName() { // Tests for keyboard-layout-editor describe('keyboard-layout-editor', function() { var home = 'http://localhost:8080/kb.html'; + var kbScreenshot = function() { + browser.waitForAngular(); + browser.driver.manage().window().setSize(1440,1024); + browser.actions().mouseMove({x:0,y:0}).perform(); + browser.waitForAngular(); + capture.snap(getSpecName(), $('#keyboard')); + }; // Simple launch test it('should launch without an error', function() { browser.get(home); - browser.driver.manage().window().setSize(1280,720); - capture.snap(getSpecName(), $('#keyboard')); + kbScreenshot(); + }); + + // Test renderings of various samples + describe('rendering sample', function() { + it('commodore-vic20', function() { + browser.get(home + "#/samples/commodore-vic20"); + browser.waitForAngular(); + browser.driver.sleep(2000); // give the browser time to load the custom font + kbScreenshot(); + }); + + it('gb-ccng', function() { + browser.get(home + "#/samples/gb-ccng"); + kbScreenshot(); + }); + + it('gb-retro-dsa', function() { + browser.get(home + "#/samples/gb-retro-dsa"); + kbScreenshot(); + }); + + it('stealth-black', function() { + browser.get(home + "#/samples/stealth-black"); + kbScreenshot(); + }); }); // Check for exceptions thrown during each scenario diff --git a/tests/screenshots/commodore-vic20.png b/tests/screenshots/commodore-vic20.png new file mode 100644 index 0000000..97a10b2 Binary files /dev/null and b/tests/screenshots/commodore-vic20.png differ diff --git a/tests/screenshots/gb-ccng.png b/tests/screenshots/gb-ccng.png new file mode 100644 index 0000000..018e690 Binary files /dev/null and b/tests/screenshots/gb-ccng.png differ diff --git a/tests/screenshots/gb-retro-dsa.png b/tests/screenshots/gb-retro-dsa.png new file mode 100644 index 0000000..8bdc5c0 Binary files /dev/null and b/tests/screenshots/gb-retro-dsa.png differ diff --git a/tests/screenshots/should-launch-without-an-error.png b/tests/screenshots/should-launch-without-an-error.png index ae7e5d6..9c4c4f9 100644 Binary files a/tests/screenshots/should-launch-without-an-error.png and b/tests/screenshots/should-launch-without-an-error.png differ diff --git a/tests/screenshots/stealth-black.png b/tests/screenshots/stealth-black.png new file mode 100644 index 0000000..6f618af Binary files /dev/null and b/tests/screenshots/stealth-black.png differ