mirror of
				https://github.com/lingble/twenty.git
				synced 2025-10-30 20:27:55 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			15 lines
		
	
	
		
			447 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			15 lines
		
	
	
		
			447 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| import { Locator, Page } from '@playwright/test';
 | |
| import { selectAllByKeyboard } from './keyboardShortcuts';
 | |
| 
 | |
| // https://github.com/microsoft/playwright/issues/14126
 | |
| // code must have \n at the end of lines otherwise everything will be in one line
 | |
| export const pasteCodeToCodeEditor = async (
 | |
|   page: Page,
 | |
|   locator: Locator,
 | |
|   code: string,
 | |
| ) => {
 | |
|   await locator.click();
 | |
|   await selectAllByKeyboard(page);
 | |
|   await page.keyboard.type(code);
 | |
| };
 | 
