[ACA-4645] Fix for shareActions e2es (#2890)

* Fixed expiry date

* Remove tests from protractor.excludes.json

* Remove unnecessary coment

* Fixed test case C286329
This commit is contained in:
Thomas Hunter 2023-01-06 16:58:33 +00:00 committed by GitHub
parent 547e17bee8
commit 28d9475ecd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 23 deletions

View File

@ -1,16 +1,5 @@
{ {
"C589205": "https://alfresco.atlassian.net/browse/ACA-4353", "C589205": "https://alfresco.atlassian.net/browse/ACA-4353",
"C261153": "https://alfresco.atlassian.net/browse/AAE-7517", "C261153": "https://alfresco.atlassian.net/browse/AAE-7517",
"C306959": "https://alfresco.atlassian.net/browse/ACA-4620", "C306959": "https://alfresco.atlassian.net/browse/ACA-4620"
"C286330": "https://alfresco.atlassian.net/browse/ACA-4645",
"C286332": "https://alfresco.atlassian.net/browse/ACA-4645",
"C286337": "https://alfresco.atlassian.net/browse/ACA-4645",
"C286333": "https://alfresco.atlassian.net/browse/ACA-4645",
"C286335": "https://alfresco.atlassian.net/browse/ACA-4645",
"C286345": "https://alfresco.atlassian.net/browse/ACA-4645",
"C306996": "https://alfresco.atlassian.net/browse/ACA-4645",
"C306997": "https://alfresco.atlassian.net/browse/ACA-4645",
"C306999": "https://alfresco.atlassian.net/browse/ACA-4645",
"C306998": "https://alfresco.atlassian.net/browse/ACA-4645",
"C307000": "https://alfresco.atlassian.net/browse/ACA-4645"
} }

View File

@ -90,7 +90,9 @@ describe('Share a file', () => {
}); });
describe('when logged in', () => { describe('when logged in', () => {
const expiryDate: any = '2022-12-25T18:30:00.000+0000'; const expiryDateObj: Date = new Date();
expiryDateObj.setFullYear(expiryDateObj.getFullYear() + 1);
const expiryDate: any = expiryDateObj.toISOString().replace('Z', '+0000');
const loginPage = new LoginPage(); const loginPage = new LoginPage();
const shareDialog = new ShareDialog(); const shareDialog = new ShareDialog();
@ -209,7 +211,7 @@ describe('Share a file', () => {
it('[C286337] Expire date is displayed correctly', async () => { it('[C286337] Expire date is displayed correctly', async () => {
await dataTable.selectItem(file6); await dataTable.selectItem(file6);
await BrowserActions.click(toolbar.shareEditButton); await BrowserActions.click(toolbar.shareButton);
await shareDialog.waitForDialogToOpen(); await shareDialog.waitForDialogToOpen();
const expireProperty = await apis.user.nodes.getSharedExpiryDate(file6Id); const expireProperty = await apis.user.nodes.getSharedExpiryDate(file6Id);
@ -220,7 +222,7 @@ describe('Share a file', () => {
it('[C286333] Disable the share link expiration', async () => { it('[C286333] Disable the share link expiration', async () => {
await dataTable.selectItem(file7); await dataTable.selectItem(file7);
await BrowserActions.click(toolbar.shareEditButton); await BrowserActions.click(toolbar.shareButton);
await shareDialog.waitForDialogToOpen(); await shareDialog.waitForDialogToOpen();
expect(await shareDialog.isExpireToggleEnabled()).toBe(true, 'Expiration is not checked'); expect(await shareDialog.isExpireToggleEnabled()).toBe(true, 'Expiration is not checked');
@ -244,7 +246,7 @@ describe('Share a file', () => {
await page.dataTable.clearSelection(); await page.dataTable.clearSelection();
await dataTable.selectItem(file8); await dataTable.selectItem(file8);
await BrowserActions.click(toolbar.shareEditButton); await BrowserActions.click(toolbar.shareButton);
await shareDialog.waitForDialogToOpen(); await shareDialog.waitForDialogToOpen();
const url2 = await shareDialog.getLinkUrl(); const url2 = await shareDialog.getLinkUrl();

View File

@ -130,7 +130,7 @@ describe('Unshare a file from Search Results', () => {
await dataTable.waitForBody(); await dataTable.waitForBody();
await dataTable.selectItem(file1); await dataTable.selectItem(file1);
await BrowserActions.click(toolbar.shareEditButton); await BrowserActions.click(toolbar.shareButton);
await shareDialog.waitForDialogToOpen(); await shareDialog.waitForDialogToOpen();
expect(await shareDialog.isShareToggleChecked()).toBe(true, 'Share toggle not checked'); expect(await shareDialog.isShareToggleChecked()).toBe(true, 'Share toggle not checked');
@ -150,7 +150,7 @@ describe('Unshare a file from Search Results', () => {
await dataTable.waitForBody(); await dataTable.waitForBody();
await dataTable.selectItem(file2); await dataTable.selectItem(file2);
await BrowserActions.click(toolbar.shareEditButton); await BrowserActions.click(toolbar.shareButton);
await shareDialog.waitForDialogToOpen(); await shareDialog.waitForDialogToOpen();
const url = await shareDialog.getLinkUrl(); const url = await shareDialog.getLinkUrl();
await BrowserActions.click(shareDialog.shareToggle); await BrowserActions.click(shareDialog.shareToggle);
@ -176,7 +176,7 @@ describe('Unshare a file from Search Results', () => {
await dataTable.waitForBody(); await dataTable.waitForBody();
await dataTable.selectItem(file3); await dataTable.selectItem(file3);
await BrowserActions.click(toolbar.shareEditButton); await BrowserActions.click(toolbar.shareButton);
await shareDialog.waitForDialogToOpen(); await shareDialog.waitForDialogToOpen();
const urlBefore = await shareDialog.getLinkUrl(); const urlBefore = await shareDialog.getLinkUrl();
@ -225,7 +225,7 @@ describe('Unshare a file from Search Results', () => {
await searchInput.searchFor(fileSite1); await searchInput.searchFor(fileSite1);
await dataTable.waitForBody(); await dataTable.waitForBody();
await dataTable.selectItem(fileSite1); await dataTable.selectItem(fileSite1);
await BrowserActions.click(toolbar.shareEditButton); await BrowserActions.click(toolbar.shareButton);
await shareDialog.waitForDialogToOpen(); await shareDialog.waitForDialogToOpen();
expect(await shareDialog.isShareToggleDisabled()).toBe(false, 'Share toggle disabled for consumer'); expect(await shareDialog.isShareToggleDisabled()).toBe(false, 'Share toggle disabled for consumer');
@ -244,7 +244,7 @@ describe('Unshare a file from Search Results', () => {
await searchInput.searchFor(fileSite2); await searchInput.searchFor(fileSite2);
await dataTable.waitForBody(); await dataTable.waitForBody();
await dataTable.selectItem(fileSite2); await dataTable.selectItem(fileSite2);
await BrowserActions.click(toolbar.shareEditButton); await BrowserActions.click(toolbar.shareButton);
await shareDialog.waitForDialogToOpen(); await shareDialog.waitForDialogToOpen();
expect(await shareDialog.isShareToggleDisabled()).toBe(false, 'Share toggle disabled for consumer'); expect(await shareDialog.isShareToggleDisabled()).toBe(false, 'Share toggle disabled for consumer');

View File

@ -33,8 +33,7 @@ export class Toolbar extends Component {
menu = new Menu(); menu = new Menu();
buttons = this.allByCss('button'); buttons = this.allByCss('button');
shareButton = this.byCss(`.mat-icon-button[title='Share']`); shareButton = this.byId('share-action-button');
shareEditButton = this.byCss(`.mat-icon-button[title='Shared Link Settings']`);
viewButton = this.byCss(`.mat-icon-button[title='View']`); viewButton = this.byCss(`.mat-icon-button[title='View']`);
downloadButton = this.byCss(`.mat-icon-button[title='Download']`); downloadButton = this.byCss(`.mat-icon-button[title='Download']`);
editFolderButton = this.byId('app.toolbar.editFolder'); editFolderButton = this.byId('app.toolbar.editFolder');