Skip to content
Merged
32 changes: 16 additions & 16 deletions tests/Umbraco.Tests.AcceptanceTest/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions tests/Umbraco.Tests.AcceptanceTest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
"prompt": "^1.2.0"
},
"dependencies": {
"@umbraco/json-models-builders": "^1.0.0",
"@umbraco/playwright-testhelpers": "^1.0.11",
"@umbraco/json-models-builders": "^1.0.2",
"@umbraco/playwright-testhelpers": "^1.0.19",
"camelize": "^1.0.0",
"faker": "^4.1.0",
"form-data": "^4.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ import { expect } from "@playwright/test";
test.describe('Umbraco Logo Information', () => {

test.beforeEach(async ({ page, umbracoApi }) => {
// TODO: REMOVE THIS WHEN SQLITE IS FIXED
// Wait so we don't bombard the API
await page.waitForTimeout(1000);
await umbracoApi.login();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -553,8 +553,9 @@ test.describe('Content tests', () => {

// Save and publish
await umbracoUi.clickElement(umbracoUi.getButtonByLabelKey(ConstantHelper.buttons.saveAndPublish));
await umbracoUi.isSuccessNotificationVisible();

// Added additional time because it could fail on pipeline because it's not saving fast enough
await umbracoUi.isSuccessNotificationVisible({timeout:20000});

// Assert
const expectedContent = '<p>Acceptance test</p>'
await expect(await umbracoApi.content.verifyRenderedContent('/contentpickercontent', expectedContent, true)).toBeTruthy();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ test.describe('System Information', () => {
await umbracoApi.users.setCurrentLanguage(enCulture);
});

async function openSystemInformation(page: Page, umbracoUi : UiHelpers) {
async function openSystemInformation(page: Page, umbracoUi: UiHelpers) {
//We have to wait for page to load, if the site is slow
await umbracoUi.clickElement(umbracoUi.getGlobalHelp());
await expect(page.locator('.umb-help-list-item').last()).toBeVisible();
Expand Down Expand Up @@ -46,4 +46,4 @@ test.describe('System Information', () => {
// Close the help panel
await page.locator('.umb-button__content').last().click();
});
});
});
Original file line number Diff line number Diff line change
@@ -1,67 +1,68 @@
import { test, expect } from '@playwright/test';
import {test, expect} from '@playwright/test';

test.describe('Login', () => {

test.beforeEach(async ({ page }) => {
await page.goto(process.env.URL + '/umbraco');
});
test('Login with correct username and password', async ({page}) => {
test.beforeEach(async ({page}) => {
await page.goto(process.env.URL + '/umbraco');
});
test('Login with correct username and password', async ({page}) => {

let error = page.locator('.text-error');
await expect(error).toBeHidden();
let error = page.locator('.text-error');
await expect(error).toBeHidden();

// Action
await page.fill('#umb-username', process.env.UMBRACO_USER_LOGIN);
await page.fill('#umb-passwordTwo', process.env.UMBRACO_USER_PASSWORD);
await page.locator('[label-key="general_login"]').click();
await page.waitForNavigation();
// Action
await page.fill('#umb-username', process.env.UMBRACO_USER_LOGIN);
await page.fill('#umb-passwordTwo', process.env.UMBRACO_USER_PASSWORD);
await page.locator('[label-key="general_login"]').click();
await page.waitForNavigation();

// Assert
await expect(page).toHaveURL(process.env.URL + '/umbraco#/content');
let usernameField = await page.locator('#umb-username');
let passwordField = await page.locator('#umb-passwordTwo');
await expect(usernameField).toHaveCount(0);
await expect(passwordField).toHaveCount(0);
});
// Assert
await expect(page).toHaveURL(process.env.URL + '/umbraco#/content');
let usernameField = await page.locator('#umb-username');
let passwordField = await page.locator('#umb-passwordTwo');
await expect(usernameField).toHaveCount(0);
await expect(passwordField).toHaveCount(0);
});

test('Login with correct username but wrong password', async({page}) => {
const username = process.env.UMBRACO_USER_LOGIN;
const password = 'wrong';
test('Login with correct username but wrong password', async ({page}) => {
const username = process.env.UMBRACO_USER_LOGIN;
const password = 'wrong';

// Precondition
let error = page.locator('.text-error');
await expect(error).toBeHidden();
// Precondition
let error = page.locator('.text-error');
await expect(error).toBeHidden();

// Action
await page.fill('#umb-username', username);
await page.fill('#umb-passwordTwo', password);
await page.locator('[label-key="general_login"]').click();
// Action
await page.fill('#umb-username', username);
await page.fill('#umb-passwordTwo', password);
await page.locator('[label-key="general_login"]').click();

// Assert
let usernameField = await page.locator('#umb-username');
let passwordField = await page.locator('#umb-passwordTwo');
await expect(error).toBeVisible();
await expect(usernameField).toBeVisible();
await expect(passwordField).toBeVisible();
});
// Assert
let usernameField = await page.locator('#umb-username');
let passwordField = await page.locator('#umb-passwordTwo');
await expect(error).toBeVisible();
await expect(usernameField).toBeVisible();
await expect(passwordField).toBeVisible();
});

test('Login with wrong username and wrong password', async({page}) => {
const username = 'wrong-username';
const password = 'wrong';
test('Login with wrong username and wrong password', async ({page}) => {
const username = 'wrong-username';
const password = 'wrong';

// Precondition
let error = page.locator('.text-error');
await expect(error).toBeHidden();
// Precondition
let error = page.locator('.text-error');
await expect(error).toBeHidden();

// Action
await page.fill('#umb-username', username);
await page.fill('#umb-passwordTwo', password);
await page.locator('[label-key="general_login"]').click();
// Action
await page.fill('#umb-username', username);
await page.fill('#umb-passwordTwo', password);
await page.locator('[label-key="general_login"]').click();

// Assert
let usernameField = await page.locator('#umb-username');
let passwordField = await page.locator('#umb-passwordTwo');
await expect(error).toBeVisible();
await expect(usernameField).toBeVisible();
await expect(passwordField).toBeVisible();
});
// Assert
let usernameField = await page.locator('#umb-username');
let passwordField = await page.locator('#umb-passwordTwo');
await expect(error).toBeVisible();
await expect(usernameField).toBeVisible();
await expect(passwordField).toBeVisible();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ test.describe('Media', () => {

// Assert
// Needs to wait before refreshing the media tree, otherwise the media files wont be moved to the folder yet
await page.waitForTimeout(1000);
await page.waitForTimeout(2500);
await umbracoUi.refreshMediaTree();
await page.locator('[data-element="tree-item-' + folderToMoveTooName + '"]').click();
for (const names of mediaFileTypes) {
Expand Down
Loading