|
|
@ -308,18 +308,41 @@ export class GridPage extends BasePage { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async copyWithKeyboard() { |
|
|
|
async copyWithKeyboard() { |
|
|
|
await this.get().press((await this.isMacOs()) ? 'Meta+C' : 'Control+C'); |
|
|
|
// retry to avoid flakiness, until text is copied to clipboard
|
|
|
|
await this.verifyToast({ message: 'Copied to clipboard' }); |
|
|
|
//
|
|
|
|
|
|
|
|
let text = ''; |
|
|
|
return this.getClipboardText(); |
|
|
|
let retryCount = 5; |
|
|
|
|
|
|
|
while (text === '') { |
|
|
|
|
|
|
|
await this.get().press((await this.isMacOs()) ? 'Meta+C' : 'Control+C'); |
|
|
|
|
|
|
|
await this.verifyToast({ message: 'Copied to clipboard' }); |
|
|
|
|
|
|
|
text = await this.getClipboardText(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// retry if text is empty till count is reached
|
|
|
|
|
|
|
|
retryCount--; |
|
|
|
|
|
|
|
if (0 === retryCount) { |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return text; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async copyWithMouse({ index, columnHeader }: CellProps) { |
|
|
|
async copyWithMouse({ index, columnHeader }: CellProps) { |
|
|
|
await this.cell.get({ index, columnHeader }).click({ button: 'right' }); |
|
|
|
// retry to avoid flakiness, until text is copied to clipboard
|
|
|
|
await this.get().page().getByTestId('context-menu-item-copy').click(); |
|
|
|
//
|
|
|
|
|
|
|
|
let text = ''; |
|
|
|
await this.verifyToast({ message: 'Copied to clipboard' }); |
|
|
|
let retryCount = 5; |
|
|
|
|
|
|
|
while (text === '') { |
|
|
|
return this.getClipboardText(); |
|
|
|
await this.cell.get({ index, columnHeader }).click({ button: 'right' }); |
|
|
|
|
|
|
|
await this.get().page().getByTestId('context-menu-item-copy').click(); |
|
|
|
|
|
|
|
await this.verifyToast({ message: 'Copied to clipboard' }); |
|
|
|
|
|
|
|
text = await this.getClipboardText(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// retry if text is empty till count is reached
|
|
|
|
|
|
|
|
retryCount--; |
|
|
|
|
|
|
|
if (0 === retryCount) { |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return text; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|