Automated browser testing (#1415)

* Move automated api tests to api directory

* First pass at automated browser testing
This commit is contained in:
Gabe Kangas
2021-09-17 14:04:09 -07:00
committed by GitHub
parent 5fc8465746
commit cc6b257470
29 changed files with 9094 additions and 25 deletions

View File

@@ -0,0 +1,33 @@
const listenForErrors = require('./lib/errors.js').listenForErrors;
const interactiveChatTest = require('./tests/chat.js').interactiveChatTest;
describe('Chat read-write embed page', () => {
beforeAll(async () => {
await page.setViewport({ width: 600, height: 700 });
listenForErrors(browser, page);
await page.goto('http://localhost:5309/embed/chat/readwrite');
});
afterAll(async () => {
await page.waitForTimeout(3000);
await page.screenshot({ path: 'screenshots/screenshot_chat_embed.png', fullPage: true });
});
const newName = 'frontend-browser-embed-test-name-change';
const fakeMessage = 'this is a test chat message sent via the automated browser tests on the read/write chat embed page.'
interactiveChatTest(browser, page, newName, fakeMessage, 'desktop');
});
describe('Chat read-only embed page', () => {
beforeAll(async () => {
await page.setViewport({ width: 500, height: 700 });
listenForErrors(browser, page);
await page.goto('http://localhost:5309/embed/chat/readonly');
});
it('should have the messages container', async () => {
await page.waitForSelector('#messages-container');
});
});