|
| 1 | +import { test, expect } from '@playwright/test'; |
| 2 | +import { GoToMockWorkflow } from '../utils/GoToWorkflow'; |
| 3 | + |
| 4 | +test( |
| 5 | + 'password mask', |
| 6 | + { |
| 7 | + tag: '@mock', |
| 8 | + }, |
| 9 | + async ({ page }) => { |
| 10 | + await page.goto('/'); |
| 11 | + |
| 12 | + await GoToMockWorkflow(page, 'Panel'); |
| 13 | + |
| 14 | + await page.getByTestId('card-http').click(); |
| 15 | + await page.getByText('Showing 0 of').click(); |
| 16 | + await page.getByText('Authentication').click(); |
| 17 | + await page.getByLabel('Operation details panel').getByText('Authentication').click(); |
| 18 | + |
| 19 | + await page.getByText('None').click(); |
| 20 | + await page.getByRole('option', { name: 'Basic' }).click(); |
| 21 | + |
| 22 | + await page.getByTestId('msla-authentication-editor-basic-username').click(); |
| 23 | + await page.keyboard.type('user'); |
| 24 | + |
| 25 | + await page.getByTestId('msla-authentication-editor-basic-password').click(); |
| 26 | + await page.keyboard.type('password'); |
| 27 | + |
| 28 | + await page.getByRole('tab', { name: 'Code view' }).click(); |
| 29 | + await expect(page.getByRole('code')).toContainText( |
| 30 | + '{ "type": "Http", "inputs": { "uri": "http://test.com", "method": "GET", "body": "@variables(\'ArrayVariable\')", "authentication": { "type": "Basic", "username": "user", "password": "password" } }, "runAfter": { "Filter_array": [ "SUCCEEDED" ] }, "runtimeConfiguration": { "contentTransfer": { "transferMode": "Chunked" } }}' |
| 31 | + ); |
| 32 | + |
| 33 | + await page.getByRole('tab', { name: 'Parameters' }).click(); |
| 34 | + |
| 35 | + await page.getByTestId('msla-authentication-editor-basic-username').click(); |
| 36 | + await page.getByTestId('msla-authentication-editor-basic-username').press('ControlOrMeta+a'); |
| 37 | + await page.getByTestId('msla-authentication-editor-basic-username').press('ControlOrMeta+c'); |
| 38 | + |
| 39 | + // Verify Show password butotn works |
| 40 | + await page.getByTestId('msla-authentication-editor-basic-password').click(); |
| 41 | + await page.keyboard.type('test'); |
| 42 | + await page.getByLabel('Show Password').click(); |
| 43 | + |
| 44 | + await page.getByTestId('msla-authentication-editor-basic-password').click(); |
| 45 | + await page.keyboard.type('2'); |
| 46 | + |
| 47 | + await page.getByRole('tab', { name: 'Code view' }).click(); |
| 48 | + await expect(page.getByRole('code')).toContainText( |
| 49 | + '{ "type": "Http", "inputs": { "uri": "http://test.com", "method": "GET", "body": "@variables(\'ArrayVariable\')", "authentication": { "type": "Basic", "username": "user", "password": "passwordtest2" } }, "runAfter": { "Filter_array": [ "SUCCEEDED" ] }, "runtimeConfiguration": { "contentTransfer": { "transferMode": "Chunked" } }}' |
| 50 | + ); |
| 51 | + |
| 52 | + await page.getByRole('tab', { name: 'Parameters' }).click(); |
| 53 | + await page.getByTestId('msla-authentication-editor-basic-password').click(); |
| 54 | + |
| 55 | + await page.getByTestId('msla-authentication-editor-basic-password').press('ArrowLeft'); |
| 56 | + await page.getByTestId('msla-authentication-editor-basic-password').press('ArrowLeft'); |
| 57 | + await page.getByTestId('msla-authentication-editor-basic-password').press('Shift+ArrowLeft'); |
| 58 | + await page.getByTestId('msla-authentication-editor-basic-password').press('Shift+ArrowLeft'); |
| 59 | + await page.getByTestId('msla-authentication-editor-basic-password').press('Shift+ArrowLeft'); |
| 60 | + await page.getByTestId('msla-authentication-editor-basic-password').press('Shift+ArrowLeft'); |
| 61 | + await page.getByTestId('msla-authentication-editor-basic-username').press('ControlOrMeta+v'); |
| 62 | + await page.keyboard.type('text'); |
| 63 | + |
| 64 | + await page.getByRole('tab', { name: 'Code view' }).click(); |
| 65 | + await expect(page.getByRole('code')).toContainText( |
| 66 | + '{ "type": "Http", "inputs": { "uri": "http://test.com", "method": "GET", "body": "@variables(\'ArrayVariable\')", "authentication": { "type": "Basic", "username": "user", "password": "passworusertextt2" } }, "runAfter": { "Filter_array": [ "SUCCEEDED" ] }, "runtimeConfiguration": { "contentTransfer": { "transferMode": "Chunked" } }}' |
| 67 | + ); |
| 68 | + } |
| 69 | +); |
0 commit comments