Skip to content

Commit

Permalink
merged with release
Browse files Browse the repository at this point in the history
  • Loading branch information
sondermanish committed Dec 24, 2024
2 parents bf58cb1 + d9a3253 commit 4744ff6
Show file tree
Hide file tree
Showing 455 changed files with 8,823 additions and 3,203 deletions.
23 changes: 22 additions & 1 deletion .github/workflows/build-client-server-count.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:
matrix_count: ${{steps.matrix.outputs.matrix_count}}
run_count: ${{ steps.countArgs.outputs.run_count }}
is-pg-build: ${{steps.args.outputs.is-pg-build}}
update_snapshot: ${{steps.args.outputs.update_snapshot}}
specs_to_run: ${{steps.args.outputs.specs_to_run}}
steps:
- name: Checkout the head commit of the branch
uses: actions/checkout@v4
Expand All @@ -38,6 +40,21 @@ jobs:
runId=$((checkArg + 0))
echo "runId=$runId" >> $GITHUB_OUTPUT
fi
# Check for update_snapshot
checkArg=${{ github.event.client_payload.slash_command.args.named.update_snapshot }}
if [[ -z "$checkArg" ]]; then
echo "update_snapshot=false" >> $GITHUB_OUTPUT
else
echo "update_snapshot=$checkArg" >> $GITHUB_OUTPUT
fi
# Check for spec file
checkArg=${{ github.event.client_payload.slash_command.args.named.specs_to_run }}
if [[ -z "$checkArg" ]]; then
echo "specs_to_run=''" >> $GITHUB_OUTPUT
else
echo "specs_to_run=$checkArg" >> $GITHUB_OUTPUT
fi
- name: Set run count
id: countArgs
Expand Down Expand Up @@ -97,7 +114,7 @@ jobs:
body: |
Tests running at: <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}>.
[Cypress dashboard](https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=${{ github.run_id }}&attempt=${{ github.run_attempt }}&selectiontype=test&testsstatus=failed&specsstatus=fail)
PR: #${{ fromJson(steps.args.outputs.pr) }}.
PR: #${{ fromJson(steps.args.outputs.pr) }} with spec: ${{steps.args.outputs.specs_to_run}} .
server-build:
name: server-build
Expand Down Expand Up @@ -149,6 +166,8 @@ jobs:
with:
pr: ${{fromJson(needs.file-check.outputs.pr)}}
run_count: ${{fromJson(needs.file-check.outputs.run_count)}}
update_snapshot: ${{fromJson(needs.file-check.outputs.update_snapshot)}}
specs_to_run: ${{needs.file-check.outputs.specs_to_run}}


ci-test-limited-existing-docker-image:
Expand All @@ -162,6 +181,8 @@ jobs:
pr: ${{fromJson(needs.file-check.outputs.pr)}}
previous-workflow-run-id: ${{ fromJson(needs.file-check.outputs.runId) }}
run_count: ${{fromJson(needs.file-check.outputs.run_count)}}
update_snapshot: ${{fromJson(needs.file-check.outputs.update_snapshot)}}
specs_to_run: ${{needs.file-check.outputs.specs_to_run}}

ci-test-limited-result:
needs: [file-check, ci-test-limited]
Expand Down
54 changes: 49 additions & 5 deletions .github/workflows/ci-test-limited-with-count.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@ on:
required: false
type: number
default: 1
update_snapshot:
description: 'Give option to update snapshot (true/false)'
required: false
type: boolean
default: false
specs_to_run:
description: 'Cypress spec file(s) to run'
required: false
type: string

workflow_call:
inputs:
pr:
Expand All @@ -35,6 +45,15 @@ on:
required: false
type: number
default: 1
update_snapshot:
description: 'Give option to update snapshot (true/false)'
required: false
type: boolean
default: false
specs_to_run:
description: 'Cypress spec file(s) to run'
required: false
type: string

jobs:
ci-test-limited:
Expand Down Expand Up @@ -111,10 +130,18 @@ jobs:
else
echo "rerun=false" >> $GITHUB_OUTPUT
fi
- name: Upload existing snapshot data
if: always()
uses: actions/upload-artifact@v4
with:
name: cypress-existing-compare-snapshots
path: ${{ github.workspace }}/app/client/cypress/snapshots
overwrite: true

# Get specs to run
- name: Get specs to run
if: steps.run_result.outputs.run_result != 'success' && steps.run_result.outputs.run_result != 'failedtest'
if: ${{ (inputs.specs_to_run == '' || inputs.specs_to_run == null || !inputs.specs_to_run) && steps.run_result.outputs.run_result != 'success' && steps.run_result.outputs.run_result != 'failedtest' }}
run: |
specs_to_run=""
while IFS= read -r line
Expand Down Expand Up @@ -349,10 +376,19 @@ jobs:
NODE_ENV: development
run: |
cd app/client
npx cypress-repeat-pro run -n ${{ inputs.run_count }} --force \
--spec ${{ env.specs_to_run }} \
if [[ "${{ inputs.update_snapshot }}" == "true" ]]; then
echo "Running Cypress with snapshot updates..."
CYPRESS_updateSnapshots=true npx cypress-repeat-pro run -n "${{ inputs.run_count }}" --force \
--spec "${{ inputs.specs_to_run }}" \
--config-file "cypress_ci_custom.config.ts" \
--browser ${{ env.BROWSER_PATH }}
--browser "${{ env.BROWSER_PATH }}"
else
echo "Running Cypress tests without snapshot updates..."
npx cypress-repeat-pro run -n "${{ inputs.run_count }}" --force \
--spec "${{ env.specs_to_run }}" \
--config-file "cypress_ci_custom.config.ts" \
--browser "${{ env.BROWSER_PATH }}"
fi
cat cy-repeat-summary.txt
# Define the path for the failure flag file
FAILURE_FLAG_FILE="ci_test_status.txt"
Expand Down Expand Up @@ -453,9 +489,17 @@ jobs:
if: always()
with:
name: server-logs
path: app/server/server-logs.log
path: ${{ github.workspace }}/app/server/server-logs.log
overwrite: true

- name: Upload new compared snapshot data
if: always()
uses: actions/upload-artifact@v4
with:
name: cypress-new-compare-snapshots
path: ${{ github.workspace }}/app/client/cypress/snapshots
overwrite: true

# Set status = success
- name: Save the status of the run
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-test-limited.yml
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ jobs:
if: failure()
with:
name: server-logs
path: app/server/server-logs.log
path: ${{ github.workspace }}/app/server/server-logs.log
overwrite: true

# Set status = success
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import {
agHelper,
appSettings,
assertHelper,
deployMode,
homePage,
locators,
} from "../../../../support/Objects/ObjectsCore";
import EditorNavigation, {
EntityType,
PageLeftPane,
} from "../../../../support/Pages/EditorNavigation";

describe(
"Bug:33601: resetWidget function causes the next async method to be undefined",
{ tags: ["@tag.JS"] },
() => {
it("1. Bug 33601", () => {
homePage.NavigateToHome();
homePage.ImportApp("resetWidgetBug33601.json");
EditorNavigation.SelectEntityByName("List1", EntityType.Widget);
PageLeftPane.expandCollapseItem("List1");
PageLeftPane.expandCollapseItem("Container1");
EditorNavigation.SelectEntityByName("Input1", EntityType.Widget);

agHelper.EnterInputText("Label", "Widget Input2");
EditorNavigation.SelectEntityByName("Button1", EntityType.Widget);
cy.get(locators._widgetInputSelector("inputwidgetv2"))
.first()
.invoke("attr", "value")
.should("contain", "Widget Input2");
agHelper
.GetAttribute(locators._imgWidgetInsideList, "src")
.then((labelValue) => {
expect(labelValue).not.to.contain("data:image/png;base64");
});

agHelper.ClickButton("Submit");
cy.get(locators._widgetInputSelector("inputwidgetv2"))
.first()
.invoke("attr", "value")
.should("be.empty");
assertHelper.WaitForNetworkCall("@postExecute");
agHelper
.GetAttribute(locators._imgWidgetInsideList, "src")
.then((labelValue) => {
expect(labelValue).to.contain("data:image/png;base64");
});

deployMode.DeployApp();
agHelper.AssertElementVisibility(appSettings.locators._header);
agHelper.EnterInputText("Label", "Widget Input2");
cy.get(locators._widgetInputSelector("inputwidgetv2"))
.first()
.invoke("attr", "value")
.should("contain", "Widget Input2");
agHelper
.GetAttribute(locators._imgWidgetInsideList, "src")
.then((labelValue) => {
expect(labelValue).not.to.contain("data:image/png;base64");
});
agHelper.ClickButton("Submit");
cy.get(locators._widgetInputSelector("inputwidgetv2"))
.first()
.invoke("attr", "value")
.should("be.empty");
agHelper
.GetAttribute(locators._imgWidgetInsideList, "src")
.then((labelValue) => {
expect(labelValue).to.contain("data:image/png;base64");
});
});
},
);
Loading

0 comments on commit 4744ff6

Please sign in to comment.