mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2026-09-09 18:02:54 +00:00
[ACS-4741] User random user instead of admin in e2e (#3022)
This commit is contained in:
@@ -24,7 +24,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { browser } from 'protractor';
|
import { browser } from 'protractor';
|
||||||
import { LoginPage, BrowsingPage, RepoClient, Utils } from '@alfresco/aca-testing-shared';
|
import { LoginPage, BrowsingPage, RepoClient, Utils, AdminActions } from '@alfresco/aca-testing-shared';
|
||||||
|
|
||||||
const PAGE_TITLES = {
|
const PAGE_TITLES = {
|
||||||
PERSONAL_FILES: 'Personal Files',
|
PERSONAL_FILES: 'Personal Files',
|
||||||
@@ -41,11 +41,17 @@ const PAGE_TITLES = {
|
|||||||
describe('Page titles', () => {
|
describe('Page titles', () => {
|
||||||
const loginPage = new LoginPage();
|
const loginPage = new LoginPage();
|
||||||
const page = new BrowsingPage();
|
const page = new BrowsingPage();
|
||||||
const adminApi = new RepoClient();
|
const username = `user-${Utils.random()}`;
|
||||||
|
const apis = new RepoClient(username, username);
|
||||||
|
const adminApiActions = new AdminActions();
|
||||||
const file = `file-${Utils.random()}.txt`;
|
const file = `file-${Utils.random()}.txt`;
|
||||||
let fileId: string;
|
let fileId: string;
|
||||||
const { searchInput } = page.header;
|
const { searchInput } = page.header;
|
||||||
|
|
||||||
|
beforeAll(async () => {
|
||||||
|
await adminApiActions.createUser({ username });
|
||||||
|
});
|
||||||
|
|
||||||
describe('on Login / Logout pages', () => {
|
describe('on Login / Logout pages', () => {
|
||||||
it('[C217155] on Login page', async () => {
|
it('[C217155] on Login page', async () => {
|
||||||
await loginPage.load();
|
await loginPage.load();
|
||||||
@@ -53,13 +59,13 @@ describe('Page titles', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('[C217156] after logout', async () => {
|
it('[C217156] after logout', async () => {
|
||||||
await loginPage.loginWithAdmin();
|
await loginPage.loginWith(username);
|
||||||
await page.signOut();
|
await page.signOut();
|
||||||
expect(await browser.getTitle()).toContain('Sign in');
|
expect(await browser.getTitle()).toContain('Sign in');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('[C280414] when pressing Back after Logout', async () => {
|
it('[C280414] when pressing Back after Logout', async () => {
|
||||||
await loginPage.loginWithAdmin();
|
await loginPage.loginWith(username);
|
||||||
await page.signOut();
|
await page.signOut();
|
||||||
await browser.navigate().back();
|
await browser.navigate().back();
|
||||||
expect(await browser.getTitle()).toContain('Sign in');
|
expect(await browser.getTitle()).toContain('Sign in');
|
||||||
@@ -68,12 +74,12 @@ describe('Page titles', () => {
|
|||||||
|
|
||||||
describe('on app pages', () => {
|
describe('on app pages', () => {
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
fileId = (await adminApi.nodes.createFile(file)).entry.id;
|
await loginPage.loginWith(username);
|
||||||
await loginPage.loginWithAdmin();
|
fileId = (await apis.nodes.createFile(file)).entry.id;
|
||||||
});
|
});
|
||||||
|
|
||||||
afterAll(async () => {
|
afterAll(async () => {
|
||||||
await adminApi.nodes.deleteNodeById(fileId);
|
await apis.nodes.deleteNodeById(fileId);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('[C217157] Personal Files page', async () => {
|
it('[C217157] Personal Files page', async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user