Skip to content

Commit

Permalink
Fix the Run command
Browse files Browse the repository at this point in the history
show File name in the header
  • Loading branch information
RahulARanger committed Jun 17, 2023
1 parent 06fd37b commit 4f7dc61
Show file tree
Hide file tree
Showing 9 changed files with 427 additions and 442 deletions.
260 changes: 260 additions & 0 deletions StandaloneTests/example.side
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,45 @@
]
]
},
{
"command": "verifyElementPresent",
"target": "css=.MuiChip-colorInfo > .MuiChip-label",
"value": "",
"insertBeforeLastCommand": false,
"frameLocation": "root",
"winHandleId": "root",
"id": "a0367ef2-1e22-438d-a550-a8aa83084c49",
"targets": [
[
"css=.MuiChip-colorInfo > .MuiChip-label",
"css:finder"
],
[
"xpath=//span[contains(.,'WithVariableNames.side')]",
"xpath:innerText"
]
],
"comment": "FileNameChip"
},
{
"command": "verifyText",
"target": "css=.MuiChip-colorInfo > .MuiChip-label",
"value": "WithVariableNames.side",
"insertBeforeLastCommand": false,
"frameLocation": "root",
"winHandleId": "root",
"id": "7693dc45-8f62-4232-a3c4-e733eac64cd9",
"targets": [
[
"css=.MuiChip-colorInfo > .MuiChip-label",
"css:finder"
],
[
"xpath=//span[contains(.,'WithVariableNames.side')]",
"xpath:innerText"
]
]
},
{
"command": "verifyElementPresent",
"target": "css=.MuiIconButton-colorWarning",
Expand Down Expand Up @@ -404,6 +443,227 @@
"comment": "TestCaseMenuLabel"
}
]
},
{
"id": "67c9a61c-e76f-4fba-b05e-572a148c8951",
"name": "Verifying the Script Generated for Test Case",
"commands": [
{
"command": "run",
"target": "HomePage",
"value": "",
"id": "46512ede-7c5e-48a5-9218-67289e10a866"
},
{
"command": "//click",
"target": "#dont-click-me",
"value": "",
"id": "4536154d-6551-4d29-9564-c14c92508efb",
"comment": "This is a disabled command"
},
{
"command": "click",
"target": "id=grouped-demo-option-1",
"value": "",
"insertBeforeLastCommand": false,
"frameLocation": "root",
"winHandleId": "root",
"id": "350b0cba-5edc-4717-814e-2bb245779e3c",
"targets": [
[
"id=grouped-demo-option-1",
"id"
],
[
"css=[data-option-index=\"1\"]",
"css:data-attr"
],
[
"css=#grouped-demo-option-1",
"css:finder"
],
[
"xpath=(//li[@id='grouped-demo-option-1'])[1]",
"xpath:attributes"
],
[
"xpath=(//ul[@id='grouped-demo-listbox']/li[2]/ul/li)[1]",
"xpath:idRelative"
]
],
"isBreakpoint": false
},
{
"command": "verifyText",
"target": "css=.MuiTypography-subtitle1",
"value": "Please fill the names of the locators.",
"insertBeforeLastCommand": false,
"frameLocation": "root",
"winHandleId": "root",
"id": "ead47c3a-9230-4068-aeb1-5ffa5a75791f",
"targets": [
[
"css=.MuiTypography-subtitle1",
"css:finder"
],
[
"xpath=//h6[contains(.,'Please fill the names of the locators.')]",
"xpath:innerText"
]
],
"isBreakpoint": false,
"comment": "locatorNameSelectionLabel"
},
{
"command": "verifyText",
"target": "css=.MuiTypography-body1",
"value": "Filter Pending [5]",
"insertBeforeLastCommand": false,
"frameLocation": "root",
"winHandleId": "root",
"id": "eaa76ddd-7d2d-4cd2-9836-4183b794c6b1",
"targets": [
[
"css=.MuiTypography-body1",
"css:finder"
]
],
"comment": "switchForPendingItemsLabel"
},
{
"command": "mouseOver",
"target": "css=.MuiSwitch-switchBase",
"value": "",
"insertBeforeLastCommand": false,
"frameLocation": "root",
"winHandleId": "root",
"id": "db0b7b90-5dcc-4f56-94b6-b353a03ac359",
"targets": [
[
"css=.MuiSwitch-switchBase",
"css:finder"
]
],
"comment": "switchForPendingItems"
},
{
"command": "verifyElementPresent",
"target": "css=.MuiSwitch-switchBase",
"value": "",
"insertBeforeLastCommand": false,
"frameLocation": "root",
"winHandleId": "root",
"id": "09e8f2b8-487b-431a-90d8-ecf5074e6e23",
"targets": [
[
"css=.MuiSwitch-switchBase",
"css:finder"
]
]
},
{
"command": "mouseOver",
"target": "css=.MuiAutocomplete-clearIndicator",
"value": "",
"insertBeforeLastCommand": false,
"frameLocation": "root",
"winHandleId": "root",
"id": "e0ed6b2c-23fc-4f3b-92e5-600898f11e5e",
"targets": [
[
"css=.MuiAutocomplete-clearIndicator",
"css:finder"
],
[
"xpath=(//button[@type='button'])[1]",
"xpath:attributes"
]
],
"comment": "clearSearch"
},
{
"command": "click",
"target": "css=.MuiAutocomplete-clearIndicator",
"value": "",
"id": "175271ca-2081-4b68-96f0-f9a1cdf6dba5"
},
{
"command": "verifyText",
"target": "id=grouped-demo-option-1",
"value": "Validating the search bar",
"insertBeforeLastCommand": false,
"frameLocation": "root",
"winHandleId": "root",
"id": "98de5163-a8b9-41c4-9a4f-42b05ae82172",
"targets": [
[
"id=grouped-demo-option-1",
"id"
],
[
"css=[data-option-index=\"1\"]",
"css:data-attr"
],
[
"css=#grouped-demo-option-1",
"css:finder"
],
[
"xpath=(//li[@id='grouped-demo-option-1'])[1]",
"xpath:attributes"
],
[
"xpath=(//ul[@id='grouped-demo-listbox']/li[2]/ul/li)[1]",
"xpath:idRelative"
]
],
"comment": "optionForValidatingSearchBar"
},
{
"command": "click",
"target": "id=grouped-demo-option-1",
"value": "",
"insertBeforeLastCommand": false,
"frameLocation": "root",
"winHandleId": "root",
"id": "45d09ad7-a6a5-4706-82fe-9cb4e73790a5",
"targets": [
[
"id=grouped-demo-option-1",
"id"
],
[
"css=[data-option-index=\"1\"]",
"css:data-attr"
],
[
"css=#grouped-demo-option-1",
"css:finder"
],
[
"xpath=(//li[@id='grouped-demo-option-1'])[1]",
"xpath:attributes"
],
[
"xpath=(//ul[@id='grouped-demo-listbox']/li[2]/ul/li)[1]",
"xpath:idRelative"
]
]
}
]
},
{
"id": "f01bbeba-da34-4b58-9968-189977f8121f",
"name": "RecordTestsOnLocal",
"commands": [
{
"id": "4c6f89a9-22ac-4382-aa15-d588b5feb220",
"command": "open",
"target": "http://localhost:3000/converter",
"value": "",
"comment": "This is just for recording the Local Server instead of the official Site. Not to be used as part of test script execution"
}
]
}
],
"snapshot": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ class Locators {
get uploadFileInput() {
return this.$("input[accept='.side']")
}
get FileNameChip() {
return this.$(".MuiChip-colorInfo > .MuiChip-label");
}
};


Expand All @@ -76,7 +79,7 @@ async function homePage() {
await browser.url("https://wticks.vercel.app/converter");
await pageClass.UploadButton.waitForExist({ reverse: false, timeout: 5000 });
await expect(pageClass.UploadButton).toHaveText("UPLOAD FILE");
await expect(pageClass.UploadDesc).toHaveText("Upload the recorded.side file");
await expect(pageClass.UploadDesc).toHaveText("Upload the recorded .side file");
await expect(pageClass.UploadBox).toBePresent();


Expand All @@ -85,7 +88,11 @@ async function homePage() {

await expect(pageClass.UploadAgain).toBePresent();
await expect(pageClass.UploadAgain).toHaveText("Upload file again");

Check failure on line 90 in StandaloneTests/uploadingAFile.js

View workflow job for this annotation

GitHub Actions / test

Running the ensured tests in order to check if the results generated are correct › Validating the Standalone Example Files: $file

Command failed: node "/home/runner/work/WTicks/WTicks/StandaloneTests/uploadingAFile.js" file:///home/runner/work/WTicks/WTicks/StandaloneTests/uploadingAFile.js:90 await expect(pageClass.UploadAgain).toHaveText("Upload file again"); ^ JestAssertionError: Expect $(`.MuiChip-label`) to have text Expected: "Upload file again" Received: "WithVariableNames.side" at homePage (file:/home/runner/work/WTicks/WTicks/StandaloneTests/uploadingAFile.js:90:41) at async file:/home/runner/work/WTicks/WTicks/StandaloneTests/uploadingAFile.js:111:5 { matcherResult: { pass: false, message: 'Expect $(`.MuiChip-label`) to have text\n' + '\n' + 'Expected: "Upload file again"\n' + 'Received: "WithVariableNames.side"' } } Node.js v18.16.0 at __tests__/testPraticalResults.test.ts:28:25

await expect(pageClass.FileNameChip).toBePresent();
await expect(pageClass.FileNameChip).toHaveText("WithVariableNames.side");
await expect(pageClass.Alerts).toBePresent();

await expect(pageClass.ScriptViewer).toBePresent();
await expect(pageClass.DefaultScript).toHaveText("\"Please complete the required info for generating the script ...\"");
await expect(pageClass.AppTitle).toHaveText("WTicks");
Expand Down
Loading

1 comment on commit 4f7dc61

@vercel
Copy link

@vercel vercel bot commented on 4f7dc61 Jun 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

wticks – ./

wticks.vercel.app
wticks-git-main-rahularanger.vercel.app
wticks-rahularanger.vercel.app

Please sign in to comment.