You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			24 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			TypeScript
		
	
			
		
		
	
	
			24 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			TypeScript
		
	
| import { Page } from '@playwright/test';
 | |
| import { User } from '../types/testing';
 | |
| import { clickOnMatchingText, typeIntoInput } from '../utilities/utils';
 | |
| // tslint:disable: no-console
 | |
| export const newUser = async (window: Page, userName: string): Promise<User> => {
 | |
|   // Create User
 | |
|   await clickOnMatchingText(window, 'Create Session ID');
 | |
|   // Wait for animation for finish creating ID
 | |
|   await window.waitForTimeout(1500);
 | |
|   //Save session ID to a variable
 | |
|   const sessionid = await window.inputValue('[data-testid=session-id-signup]');
 | |
|   await clickOnMatchingText(window, 'Continue');
 | |
|   // Input username = testuser
 | |
|   await typeIntoInput(window, 'display-name-input', userName);
 | |
|   await clickOnMatchingText(window, 'Get started');
 | |
|   // save recovery phrase
 | |
|   await clickOnMatchingText(window, 'Reveal Recovery Phrase');
 | |
|   const recoveryPhrase = await window.innerText('[data-testid=recovery-phrase-seed-modal]');
 | |
| 
 | |
|   console.info(`${userName}: Session ID: ${sessionid} and Recovery phrase: ${recoveryPhrase}`);
 | |
|   await window.click('.session-icon-button.small');
 | |
|   return { userName, sessionid, recoveryPhrase };
 | |
| };
 |