Skip to content

Commit

Permalink
test(designer): Fix E2E real api test
Browse files Browse the repository at this point in the history
  • Loading branch information
hartra344 committed Apr 23, 2024
1 parent 851c9b6 commit c7adbb7
Show file tree
Hide file tree
Showing 2 changed files with 152 additions and 133 deletions.
283 changes: 151 additions & 132 deletions e2e/designer/real-api/copypastescope.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ test.describe(
tag: '@real',
},
() => {
beforeEach(async () => {});
beforeEach(async () => { });
test('Expect Copy and Paste of Scopes to work on single workflow', async ({ page, context, browserName }) => {
if (browserName === 'webkit') {
context.grantPermissions(['clipboard-read'], { origin: 'http://localhost:4200' });
Expand All @@ -25,6 +25,7 @@ test.describe(
await page.keyboard.press('Meta+C');
await page.getByTestId('rf__edge-For_each-Filter_array').getByLabel('Insert a new step between For').focus();
await page.keyboard.press('Meta+V');
await page.waitForTimeout(1000);
const serialized: any = await page.evaluate(() => {
return new Promise((resolve) => {
setTimeout(() => {
Expand All @@ -39,161 +40,179 @@ test.describe(
);

const verificationWorkflow = {
$schema: 'https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#',
actions: {
Initialize_ArrayVariable: {
type: 'InitializeVariable',
inputs: {
variables: [
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"actions": {
"Initialize_ArrayVariable": {
"type": "InitializeVariable",
"inputs": {
"variables": [
{
name: 'ArrayVariable',
type: 'array',
value: [
"name": "ArrayVariable",
"type": "array",
"value": [
{
document: 'A',
min: 7500001,
policy: 'X',
"document": "A",
"min": 7500001,
"policy": "X"
},
{
document: 'B',
min: 7500001,
policy: 'Y',
"document": "B",
"min": 7500001,
"policy": "Y"
},
{
document: 'C',
min: 7500001,
policy: 'Z',
},
],
},
],
"document": "C",
"min": 7500001,
"policy": "Z"
}
]
}
]
},
runAfter: {},
"runAfter": {}
},
Filter_array: {
type: 'Query',
inputs: {
from: "@body('Parse_JSON')",
where: "@not(contains(length(split(item(), '|')?[0]),length(split(item(), '|')?[0])))",
},
runAfter: {
'For_each-copy': ['SUCCEEDED'],
"Filter_array": {
"type": "Query",
"inputs": {
"from": "@body('Parse_JSON')",
"where": "@not(contains(length(split(item(), '|')?[0]),length(split(item(), '|')?[0])))"
},
"runAfter": {
"For_each-copy": [
"SUCCEEDED"
]
}
},
HTTP: {
type: 'Http',
inputs: {
uri: 'http://test.com',
method: 'GET',
body: "@variables('ArrayVariable')",
"HTTP": {
"type": "Http",
"inputs": {
"uri": "http://test.com",
"method": "GET",
"body": "@variables('ArrayVariable')"
},
runAfter: {
Filter_array: ['SUCCEEDED'],
},
runtimeConfiguration: {
contentTransfer: {
transferMode: 'Chunked',
},
"runAfter": {
"Filter_array": [
"SUCCEEDED"
]
},
"runtimeConfiguration": {
"contentTransfer": {
"transferMode": "Chunked"
}
}
},
For_each: {
type: 'foreach',
foreach: "@triggerOutputs()?['body']?['array']",
actions: {
Parse_JSON: {
type: 'ParseJson',
inputs: {
content: "@{triggerBody()?['string']}@{variables('ArrayVariable')}@{item()?['item1']}",
schema: {
type: 'array',
items: {
type: 'object',
properties: {
document: {
type: 'string',
},
min: {
type: 'integer',
"For_each": {
"type": "foreach",
"foreach": "@triggerOutputs()?['body']?['array']",
"actions": {
"Parse_JSON": {
"type": "ParseJson",
"inputs": {
"content": "@{triggerBody()?['string']}@{variables('ArrayVariable')}@{item()?['item1']}",
"schema": {
"type": "array",
"items": {
"type": "object",
"properties": {
"document": {
"type": "string"
},
policy: {
type: 'string',
"min": {
"type": "integer"
},
"policy": {
"type": "string"
}
},
required: ['document', 'min', 'policy'],
},
},
},
},
},
runAfter: {
Initialize_ArrayVariable: ['SUCCEEDED'],
"required": [
"document",
"min",
"policy"
]
}
}
}
}
},
"runAfter": {
"Initialize_ArrayVariable": [
"SUCCEEDED"
]
}
},
'For_each-copy': {
type: 'foreach',
foreach: "@triggerOutputs()?['body']?['array']",
actions: {
Parse_JSON_1: {
type: 'ParseJson',
inputs: {
content: "@{triggerBody()?['string']}@{variables('ArrayVariable')}@{item()?['item1']}",
schema: {
type: 'array',
items: {
type: 'object',
properties: {
document: {
type: 'string',
},
min: {
type: 'integer',
"For_each-copy": {
"type": "foreach",
"foreach": "@triggerOutputs()?['body']?['array']",
"actions": {
"Parse_JSON_1": {
"type": "ParseJson",
"inputs": {
"content": "@{triggerBody()?['string']}@{variables('ArrayVariable')}@{item()?['item1']}",
"schema": {
"type": "array",
"items": {
"type": "object",
"properties": {
"document": {
"type": "string"
},
policy: {
type: 'string',
"min": {
"type": "integer"
},
"policy": {
"type": "string"
}
},
required: ['document', 'min', 'policy'],
},
},
},
},
},
runAfter: {
For_each: ['SUCCEEDED'],
"required": [
"document",
"min",
"policy"
]
}
}
}
}
},
},
"runAfter": {
"For_each": [
"SUCCEEDED"
]
}
}
},
contentVersion: '1.0.0.0',
outputs: {},
triggers: {
manual: {
type: 'Request',
kind: 'Http',
inputs: {
schema: {
type: 'object',
properties: {
array: {
type: 'array',
items: {
type: 'object',
properties: {
item1: {
type: 'string',
},
"contentVersion": "1.0.0.0",
"outputs": {},
"triggers": {
"manual": {
"type": "Request",
"kind": "Http",
"inputs": {
"schema": {
"type": "object",
"properties": {
"array": {
"type": "array",
"items": {
"type": "object",
"properties": {
"item1": {
"type": "string"
}
},
required: ['item1'],
},
"required": [
"item1"
]
}
},
string: {
type: 'string',
"string": {
"type": "string"
},
number: {
type: 'integer',
},
},
},
},
},
},
"number": {
"type": "integer"
}
}
}
}
}
}
};
2 changes: 1 addition & 1 deletion playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default defineConfig({
// workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: 'html',
timeout: 1_000 * 60,
timeout: 1_000 * 60 * 5,
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
Expand Down

0 comments on commit c7adbb7

Please sign in to comment.