mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
[ACA-1679] Add remaining tests for page titles (#566)
* add tests for Page titles e2e
This commit is contained in:
committed by
Adina Parpalita
parent
972b08700f
commit
d677fbdd35
@@ -26,17 +26,29 @@
|
|||||||
import { ElementFinder, by } from 'protractor';
|
import { ElementFinder, by } from 'protractor';
|
||||||
import { Component } from '../component';
|
import { Component } from '../component';
|
||||||
import { UserInfo } from './user-info';
|
import { UserInfo } from './user-info';
|
||||||
|
import { protractor } from 'protractor';
|
||||||
|
|
||||||
export class Header extends Component {
|
export class Header extends Component {
|
||||||
private locators = {
|
private locators = {
|
||||||
logoLink: by.css('.app-menu__title'),
|
logoLink: by.css('.app-menu__title'),
|
||||||
userInfo: by.css('aca-current-user')
|
userInfo: by.css('aca-current-user'),
|
||||||
|
searchButton: by.css('#adf-search-button'),
|
||||||
|
searchBar: by.css('#adf-control-input')
|
||||||
};
|
};
|
||||||
|
|
||||||
logoLink: ElementFinder = this.component.element(this.locators.logoLink);
|
logoLink: ElementFinder = this.component.element(this.locators.logoLink);
|
||||||
userInfo: UserInfo = new UserInfo(this.component);
|
userInfo: UserInfo = new UserInfo(this.component);
|
||||||
|
searchButton: ElementFinder = this.component.element(this.locators.searchButton);
|
||||||
|
searchBar: ElementFinder = this.component.element(this.locators.searchBar);
|
||||||
|
|
||||||
constructor(ancestor?: ElementFinder) {
|
constructor(ancestor?: ElementFinder) {
|
||||||
super('adf-layout-header', ancestor);
|
super('adf-layout-header', ancestor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
searchForText(text: string) {
|
||||||
|
return this.searchBar.clear()
|
||||||
|
.then(() => this.searchBar.sendKeys(text))
|
||||||
|
.then(() => this.searchBar.sendKeys(protractor.Key.ENTER));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -64,6 +64,12 @@ export const SIDEBAR_LABELS = {
|
|||||||
TRASH: 'Trash'
|
TRASH: 'Trash'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Page titles
|
||||||
|
export const PAGE_TITLES = {
|
||||||
|
VIEWER: 'Preview',
|
||||||
|
SEARCH: 'Search Results'
|
||||||
|
};
|
||||||
|
|
||||||
// Site visibility
|
// Site visibility
|
||||||
export const SITE_VISIBILITY = {
|
export const SITE_VISIBILITY = {
|
||||||
PUBLIC: 'PUBLIC',
|
PUBLIC: 'PUBLIC',
|
||||||
|
@@ -25,13 +25,20 @@
|
|||||||
|
|
||||||
import { browser } from 'protractor';
|
import { browser } from 'protractor';
|
||||||
|
|
||||||
import { SIDEBAR_LABELS } from '../../configs';
|
import { SIDEBAR_LABELS, PAGE_TITLES } from '../../configs';
|
||||||
import { LoginPage, LogoutPage, BrowsingPage } from '../../pages/pages';
|
import { LoginPage, LogoutPage, BrowsingPage } from '../../pages/pages';
|
||||||
|
import { RepoClient } from '../../utilities/repo-client/repo-client';
|
||||||
|
import { Utils } from '../../utilities/utils';
|
||||||
|
|
||||||
|
|
||||||
describe('Page titles', () => {
|
describe('Page titles', () => {
|
||||||
const loginPage = new LoginPage();
|
const loginPage = new LoginPage();
|
||||||
const logoutPage = new LogoutPage();
|
const logoutPage = new LogoutPage();
|
||||||
const page = new BrowsingPage();
|
const page = new BrowsingPage();
|
||||||
|
const adminApi = new RepoClient();
|
||||||
|
const { nodes: nodesApi } = adminApi;
|
||||||
|
const file = `file-${Utils.random()}.txt`; let fileId;
|
||||||
|
const header = page.header;
|
||||||
|
|
||||||
xit('');
|
xit('');
|
||||||
|
|
||||||
@@ -124,5 +131,46 @@ describe('Page titles', () => {
|
|||||||
expect(browser.getTitle()).toContain(label);
|
expect(browser.getTitle()).toContain(label);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('on File Viewer', () => {
|
||||||
|
beforeAll( async (done) => {
|
||||||
|
fileId = (await nodesApi.createFile(file)).entry.id;
|
||||||
|
await loginPage.loginWithAdmin();
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
|
||||||
|
afterAll( async (done) => {
|
||||||
|
await logoutPage.load();
|
||||||
|
await adminApi.nodes.deleteNodeById(fileId);
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('File Preview page - [C280415]', async () => {
|
||||||
|
await page.sidenav.navigateToLinkByLabel(SIDEBAR_LABELS.PERSONAL_FILES);
|
||||||
|
await page.dataTable.waitForHeader();
|
||||||
|
await page.dataTable.doubleClickOnRowByName(file);
|
||||||
|
expect(await browser.getTitle()).toContain(PAGE_TITLES.VIEWER);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe ('on Search query', () => {
|
||||||
|
beforeAll( async (done) => {
|
||||||
|
await loginPage.loginWithAdmin();
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
|
||||||
|
afterAll( async (done) => {
|
||||||
|
await logoutPage.load();
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Search Results page - [C280413]', async () => {
|
||||||
|
await header.searchButton.click();
|
||||||
|
await page.dataTable.waitForHeader();
|
||||||
|
await header.searchForText(file);
|
||||||
|
expect(await browser.getTitle()).toContain(PAGE_TITLES.SEARCH);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user