From 7aa9af665e0313335d52c03624cb9d4bdcfa1e24 Mon Sep 17 00:00:00 2001 From: Salah Aldeen Al Saleh Date: Fri, 11 Oct 2024 09:50:02 -0700 Subject: [PATCH] Move change-license test to Playwright --- .github/workflows/build-test.yaml | 5 +-- dev/dockerfiles/kotsadm/Dockerfile.local | 28 +++++++------- e2e/inventory/inventory.go | 2 +- .../@change-license/community-license.yaml | 23 ++++++++++++ .../different-app-license.yaml | 24 ++++++++++++ .../@change-license/expired-license.yaml | 23 ++++++++++++ .../tests/@change-license/paid-license.yaml | 23 ++++++++++++ .../tests/@change-license/test.spec.ts | 37 +++++++++++++++++++ 8 files changed, 146 insertions(+), 19 deletions(-) create mode 100644 e2e/playwright/tests/@change-license/community-license.yaml create mode 100644 e2e/playwright/tests/@change-license/different-app-license.yaml create mode 100644 e2e/playwright/tests/@change-license/expired-license.yaml create mode 100644 e2e/playwright/tests/@change-license/paid-license.yaml create mode 100644 e2e/playwright/tests/@change-license/test.spec.ts diff --git a/.github/workflows/build-test.yaml b/.github/workflows/build-test.yaml index 79b5cbabed..88f9562666 100644 --- a/.github/workflows/build-test.yaml +++ b/.github/workflows/build-test.yaml @@ -1118,7 +1118,6 @@ jobs: kots-dockerhub-username: '${{ secrets.E2E_DOCKERHUB_USERNAME }}' kots-dockerhub-password: '${{ secrets.E2E_DOCKERHUB_PASSWORD }}' - validate-change-license: runs-on: ubuntu-20.04 needs: [ enable-tests, can-run-ci, build-kots, build-kotsadm, build-e2e, build-kurl-proxy, build-migrations, push-minio, push-rqlite ] @@ -1150,8 +1149,6 @@ jobs: kots-namespace: 'change-license' k8s-distribution: ${{ matrix.cluster.distribution }} k8s-version: ${{ matrix.cluster.version }} - testim-access-token: '${{ secrets.TESTIM_ACCESS_TOKEN }}' - testim-branch: ${{ github.head_ref == 'main' && 'master' || github.head_ref }} replicated-api-token: '${{ secrets.C11Y_MATRIX_TOKEN }}' kots-dockerhub-username: '${{ secrets.E2E_DOCKERHUB_USERNAME }}' kots-dockerhub-password: '${{ secrets.E2E_DOCKERHUB_PASSWORD }}' @@ -4331,7 +4328,6 @@ jobs: # testim tests - validate-existing-online-install-minimal - validate-version-history-pagination - - validate-change-license - validate-min-kots-version - validate-target-kots-version - validate-range-kots-version @@ -4346,6 +4342,7 @@ jobs: - validate-change-channel - validate-multi-app-backup-and-restore - validate-multi-app-install + - validate-change-license # non-testim tests - validate-minimal-rbac - validate-minimal-rbac-override diff --git a/dev/dockerfiles/kotsadm/Dockerfile.local b/dev/dockerfiles/kotsadm/Dockerfile.local index 6a60471335..0eb5324cd7 100644 --- a/dev/dockerfiles/kotsadm/Dockerfile.local +++ b/dev/dockerfiles/kotsadm/Dockerfile.local @@ -7,18 +7,18 @@ FROM golang:1.23-alpine RUN apk add --no-cache ca-certificates s3cmd curl git make bash # Install Kubectl 1.29 -ENV KUBECTL_1_29_VERSION=v1.29.0 -ENV KUBECTL_1_29_URL=https://dl.k8s.io/release/${KUBECTL_1_29_VERSION}/bin/linux/amd64/kubectl -ENV KUBECTL_1_29_SHA256SUM=0e03ab096163f61ab610b33f37f55709d3af8e16e4dcc1eb682882ef80f96fd5 -RUN curl -fsSLO "${KUBECTL_1_29_URL}" \ - && echo "${KUBECTL_1_29_SHA256SUM} kubectl" | sha256sum -c - \ +ENV KUBECTL_VERSION=v1.31.0 +ENV KUBECTL_URL=https://dl.k8s.io/release/v1.31.0/bin/linux/arm64/kubectl +ENV KUBECTL_SHA256SUM=f42832db7d77897514639c6df38214a6d8ae1262ee34943364ec1ffaee6c009c +RUN curl -fsSLO "${KUBECTL_URL}" \ + && echo "${KUBECTL_SHA256SUM} kubectl" | sha256sum -c - \ && chmod +x kubectl \ && mv kubectl /usr/local/bin//kubectl # Install kustomize 5 -ENV KUSTOMIZE5_VERSION=5.1.1 -ENV KUSTOMIZE5_URL=https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v${KUSTOMIZE5_VERSION}/kustomize_v${KUSTOMIZE5_VERSION}_linux_amd64.tar.gz -ENV KUSTOMIZE5_SHA256SUM=3b30477a7ff4fb6547fa77d8117e66d995c2bdd526de0dafbf8b7bcb9556c85d +ENV KUSTOMIZE5_VERSION=5.5.0 +ENV KUSTOMIZE5_URL=https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v${KUSTOMIZE5_VERSION}/kustomize_v${KUSTOMIZE5_VERSION}_linux_arm64.tar.gz +ENV KUSTOMIZE5_SHA256SUM=b4170d1acb8cfacace9f72884bef957ff56efdcd4813b66e7604aabc8b57e93d RUN curl -fsSL -o kustomize.tar.gz "${KUSTOMIZE5_URL}" \ && echo "${KUSTOMIZE5_SHA256SUM} kustomize.tar.gz" | sha256sum -c - \ && tar -xzvf kustomize.tar.gz \ @@ -27,15 +27,15 @@ RUN curl -fsSL -o kustomize.tar.gz "${KUSTOMIZE5_URL}" \ && mv kustomize /usr/local/bin/kustomize # Install helm v3 -ENV HELM3_VERSION=3.13.2 -ENV HELM3_URL=https://get.helm.sh/helm-v${HELM3_VERSION}-linux-amd64.tar.gz -ENV HELM3_SHA256SUM=55a8e6dce87a1e52c61e0ce7a89bf85b38725ba3e8deb51d4a08ade8a2c70b2d +ENV HELM3_VERSION=3.16.2 +ENV HELM3_URL=https://get.helm.sh/helm-v${HELM3_VERSION}-linux-arm64.tar.gz +ENV HELM3_SHA256SUM=1888301aeb7d08a03b6d9f4d2b73dcd09b89c41577e80e3455c113629fc657a4 RUN cd /tmp && curl -fsSL -o helm.tar.gz "${HELM3_URL}" \ && echo "${HELM3_SHA256SUM} helm.tar.gz" | sha256sum -c - \ && tar -xzvf helm.tar.gz \ - && chmod a+x linux-amd64/helm \ - && mv linux-amd64/helm /usr/local/bin/helm \ - && rm -rf helm.tar.gz linux-amd64 + && chmod a+x linux-arm64/helm \ + && mv linux-arm64/helm /usr/local/bin/helm \ + && rm -rf helm.tar.gz linux-arm64 WORKDIR /replicatedhq/kots diff --git a/e2e/inventory/inventory.go b/e2e/inventory/inventory.go index c456d99449..fa87cfbcc4 100644 --- a/e2e/inventory/inventory.go +++ b/e2e/inventory/inventory.go @@ -92,8 +92,8 @@ func NewVersionHistoryPagination() Test { func NewChangeLicense() Test { return Test{ ID: "@change-license", - TestimSuite: "change-license", Namespace: "change-license", + AppSlug: "change-license", UpstreamURI: "change-license/automated", } } diff --git a/e2e/playwright/tests/@change-license/community-license.yaml b/e2e/playwright/tests/@change-license/community-license.yaml new file mode 100644 index 0000000000..a1f03d4f3a --- /dev/null +++ b/e2e/playwright/tests/@change-license/community-license.yaml @@ -0,0 +1,23 @@ +apiVersion: kots.io/v1beta1 +kind: License +metadata: + name: change-license-community +spec: + appSlug: change-license + channelID: 27IsVgJe0RzlGKfq9GtZWVkEorT + channelName: Automated + customerName: change-license-community + endpoint: https://replicated.app + entitlements: + expires_at: + description: License Expiration + title: Expiration + value: "" + valueType: String + isGitOpsSupported: true + isNewKotsUiEnabled: true + isSnapshotSupported: true + licenseID: 27It1Yolp7CXqcrmCastwGbBRRs + licenseSequence: 1 + licenseType: community + signature: eyJsaWNlbnNlRGF0YSI6ImV5SmhjR2xXWlhKemFXOXVJam9pYTI5MGN5NXBieTkyTVdKbGRHRXhJaXdpYTJsdVpDSTZJa3hwWTJWdWMyVWlMQ0p0WlhSaFpHRjBZU0k2ZXlKdVlXMWxJam9pWTJoaGJtZGxMV3hwWTJWdWMyVXRZMjl0YlhWdWFYUjVJbjBzSW5Od1pXTWlPbnNpYkdsalpXNXpaVWxFSWpvaU1qZEpkREZaYjJ4d04wTlljV055YlVOaGMzUjNSMkpDVWxKeklpd2liR2xqWlc1elpWUjVjR1VpT2lKamIyMXRkVzVwZEhraUxDSmpkWE4wYjIxbGNrNWhiV1VpT2lKamFHRnVaMlV0YkdsalpXNXpaUzFqYjIxdGRXNXBkSGtpTENKaGNIQlRiSFZuSWpvaVkyaGhibWRsTFd4cFkyVnVjMlVpTENKamFHRnVibVZzU1VRaU9pSXlOMGx6Vm1kS1pUQlNlbXhIUzJaeE9VZDBXbGRXYTBWdmNsUWlMQ0pqYUdG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lXTnNUazlrV0VKWVlWUnNibFp1WkhkVWF6UXpUVWhvTmxsNlFrbGtiVnB6WlVac1QyVlVhRU5aTVhCNVZFaEdNVnBYUmpGVGJWWnhZMWhrYlZGV1pFUk9SVkY2VTJ4R2FGZHFWbk5oVmtsM1VUSm9hMU13Umt4Uk1IUTFXV3RPYTAxR1ZURk5SV2d6WVRCc05GRlZWWGhTVjJzMFZWaHZkbVZIVm14amJXZ3pWR3BHUjFaVlRrVmFiRlo0VmpOQ01sWlhWa1JrYldoWFRWTTVXRTFJVlRCamEyTTFVekpvZDJGSFZuTmlNa3BRV1ZWMFZsWnJhelJPVmxreFYwVnNTRlZwZEZaVVZuQnlaRE5XTVUweWVEUlJWVGd6VXpKV2QyTnFUbE5OV0U1VlRsVm5NbHBHYUd4VlYzUnJUVE5TVTFsVGRFSlNiRnBYWW0xd2QySnFRWFpSYkdjeFRWZEtTRnBZUWpWWlZURlRWRzV3TVZFeVZraGhNRFUxWkdwWk1WRlVWa3BpVlU1aFZsWndjbEZXV2s5bFZ6VkpUV3BzZVZaWWFFTlRhWFJMWW01RmQxRXpVazlPUjBwVVRqQTFkbUpyTlROVlNFNTVWa2RvV2xOcmJGUlJiRVo0WXpOT2FGRXliekpPVjFwS1pHcFNkR0V6VWtoTlNFWnNVVE5rYVZkcmVGUk9NalZoWVVSa1VGcFhNVUpsVlRWUFRrWkdlRlZ0ZUhsbGFscEVUbnBXUmxSNlRtaGlSa0V6VWxkR2IxUlhZemxRVTBselNXMWtjMkl5U21oaVJYUnNaVlZzYTBscWIybFpiVkpzV2xSVk1rNVVXWGRaTWxwcFRrUk9hazlYU1hsUFIwcHRUMVJvYkZsWFRtaGFiVVV5VGtSWmFXWlJQVDBpZlE9PSJ9 diff --git a/e2e/playwright/tests/@change-license/different-app-license.yaml b/e2e/playwright/tests/@change-license/different-app-license.yaml new file mode 100644 index 0000000000..b90a7ce254 --- /dev/null +++ b/e2e/playwright/tests/@change-license/different-app-license.yaml @@ -0,0 +1,24 @@ +apiVersion: kots.io/v1beta1 +kind: License +metadata: + name: airgapongitopsonexpirenevertypedev +spec: + appSlug: cluster-admin + channelID: 1f9ODdHVNfIbsOd7IuK9NWvUZ8v + channelName: Automated + customerName: airgap=on, gitops=on, expire=never, type=dev + endpoint: https://replicated.app + entitlements: + expires_at: + description: License Expiration + title: Expiration + value: "" + valueType: String + isAirgapSupported: true + isGitOpsSupported: true + isNewKotsUiEnabled: true + isSnapshotSupported: true + licenseID: 1f9OTJjVzgJlvpNcyXgNTZwh5pT + licenseSequence: 3 + licenseType: dev + signature: eyJsaWNlbnNlRGF0YSI6ImV5SmhjR2xXWlhKemFXOXVJam9pYTI5MGN5NXBieTkyTVdKbGRHRXhJaXdpYTJsdVpDSTZJa3hwWTJWdWMyVWlMQ0p0WlhSaFpHRjBZU0k2ZXlKdVlXMWxJam9pWVdseVoyRndiMjVuYVhSdmNITnZibVY0Y0dseVpXNWxkbVZ5ZEhsd1pXUmxkaUo5TENKemNHVmpJanA3SW14cFkyVnVjMlZKUkNJNklqRm1PVTlVU21wV2VtZEtiSFp3VG1ONVdHZE9WRnAzYURWd1ZDSXNJbXhwWTJWdWMyVlVlWEJsSWpvaVpHVjJJaXdpWTNWemRHOXRaWEpPWVcxbElqb2lZV2x5WjJGd1BXOXVMQ0JuYVhSdmNITTliMjRzSUdWNGNHbHlaVDF1WlhabGNpd2dkSGx3WlQxa1pYWWlMQ0poY0hCVGJIVm5Jam9pWTJ4MWMzUmxjaTFoWkcxcGJpSXNJbU5vWVc1dVpXeEpSQ0k2SWpGbU9VOUVaRWhXVG1aSlluTlBaRGRKZFVzNVRsZDJWVm80ZGlJc0ltTm9ZVzV1Wld4T1lXMWxJam9pUVhWMGIyMWhkR1ZrSWl3aWJHbGpaVzV6WlZObGNYVmxibU5sSWpvekxDSmxibVJ3YjJsdWRDSTZJbWgwZEhCek9pOHZjbVZ3YkdsallYUmxaQzVoY0hBaUxDSmxiblJwZEd4bGJXVnVkSE1pT25zaVpYaHdhWEp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TTWs1c1ZFWldVMUl5YUhwa1JrSkRaRzVPU0dNeWJGQmpTRnBaVWxSc2NXRnNhR3hUVjNCVlZFVjNlbU14VWpOaFdFcHZXVlZGTUdGRVFYWk9SVFZ4VFVaS05rNVVWbEJVYTJRMVVrZFNlRlo2V2paVVdHaEhVMnBTYVZZeVRrZE9iR1J5VGxjMWVtUnJUalphTVZWNFN6SktjVmxZUm1sV2JXeElaRWhPZDFWVVRtcGhiVTQxV1ROcmQxWkVhRUpXVjNCU1UwZDRORlo2V2xGVk1qVnhWRWRhVTFsWVpFdE5hekV4VG14b2QxWkZOSHBVUjNkNFVrUldUbFZ0UmpSVGJFNXpWMGRzVUUxVlZtOWFSVGxTVDFWSmVWSXpWWHBqV0dRMllraFplRXd3YUZoVk0xSlFaVVpvYm1SRlJrZFdSM1I2VTBjNVdsSXlOVlphVlZKNlN6RlZOVlZHVm0xamJYQjZVMWhTYVZOc1NscGtiRTUxVWpCT2QySllSa1JsUjBwVFV6SXhibFJyTVhKUmVtaFdXbFJTZW1JeVRsSlphbFV5VXpCTk5WVnVTVEJTTVVwYVkzcGplVkZxUWpGVU0wcEVVbFJDYUdKRWF6TmthVGxUVVcxd2JsWklXbkJOU0ZKMVZWaE9hV1JYWXpsUVUwbHpTVzFrYzJJeVNtaGlSWFJzWlZWc2EwbHFiMmxaYlZKc1dsUlZNazVVV1hkWk1scHBUa1JPYWs5WFNYbFBSMHB0VDFSb2JGbFhUbWhhYlVVeVRrUlphV1pSUFQwaWZRPT0ifQ== diff --git a/e2e/playwright/tests/@change-license/expired-license.yaml b/e2e/playwright/tests/@change-license/expired-license.yaml new file mode 100644 index 0000000000..13eba434c1 --- /dev/null +++ b/e2e/playwright/tests/@change-license/expired-license.yaml @@ -0,0 +1,23 @@ +apiVersion: kots.io/v1beta1 +kind: License +metadata: + name: change-license-expired +spec: + appSlug: change-license + channelID: 27IsVgJe0RzlGKfq9GtZWVkEorT + channelName: Automated + customerName: change-license-expired + endpoint: https://replicated.app + entitlements: + expires_at: + description: License Expiration + title: Expiration + value: "2022-04-02T20:56:05Z" + valueType: String + isGitOpsSupported: true + isNewKotsUiEnabled: true + isSnapshotSupported: true + licenseID: 27ItNiyE5Uc1z8pI8YUEjbOzHpn + licenseSequence: 1 + licenseType: trial + signature: eyJsaWNlbnNlRGF0YSI6ImV5SmhjR2xXWlhKemFXOXVJam9pYTI5MGN5NXBieTkyTVdKbGRHRXhJaXdpYTJsdVpDSTZJa3hwWTJWdWMyVWlMQ0p0WlhSaFpHRjBZU0k2ZXlKdVlXMWxJam9pWTJoaGJtZGxMV3hwWTJWdWMyVXRaWGh3YVhKbFpDSjlMQ0p6Y0dWaklqcDdJbXhwWTJWdWMyVkpSQ0k2SWpJM1NYUk9hWGxGTlZWak1YbzRjRWs0V1ZWRmFtSlBla2h3YmlJc0lteHBZMlZ1YzJWVWVYQmxJam9pZEhKcFlXd2lMQ0pqZFhOMGIyMWxjazVoYldVaU9pSmphR0Z1WjJVdGJHbGpaVzV6WlMxbGVIQnBjbVZrSWl3aVlYQndVMngxWnlJNkltTm9ZVzVuWlMxc2FXTmxibk5sSWl3aVkyaGhibTVsYkVsRUlqb2lNamRKYzFablNtVXdVbnBzUjB0bWNUbEhkRnBYVm10RmIzSlVJaXdpWTJoaGJtNWxiRTVoYldVaU9pSkJkWFJ2YldGMFpXUWlMQ0pzYVdObGJuTmxVMlZ4ZFdWdVkyVWlPakVzSW1WdVpIQnZhVzUwSWpvaWFIUjBjSE02THk5eVpYQnNhV05oZEdWa0xtRndjQ0lzSW1WdWRHbDBiR1Z0Wlc1MGN5STZleUpsZUhCcGNtVnpYMkYwSWpwN0luUnBkR3hsSWpvaVJYaHdhWEpoZEdsdmJpSXNJbVJsYzJOeWFYQjBhVzl1SWpvaVRHbGpaVzV6WlNCRmVIQnBjbUYwYVc5dUlpd2lkbUZzZFdVaU9pSXlNREl5TFRBMExUQXlWREl3T2pVMk9qQTFXaUlzSW5aaGJIVmxWSGx3WlNJNklsTjBjbWx1Wnl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GSjFaVzVDUjA5WE5XcFdNMVpKWVdwYWJWUXljM2xPVnpoNlRqSTVNR0p0TlZCVFZrWlFaRVU1U2xsVWJETk9RM1EwVFVad2NGb3lTbTlhV0VKUFRVVlZjbVJYY0ZGVk0yaHlVekZTVlU1RVZsQk1Na1pGWVcweGFWcEhjRTVrTUZvMFZXdDBSbE5ET1VaYVJVNVVWRE5CTkdNelNuTldWMFpQVWxkNFRHTnJZM2xrZWxKSFkydFNTV1ZGTVVOT1ZWcFBaR3BhYldSSWFIQlJXSEIyV1cxU2IwNVhiekZPUnpGYVdsaENlVmRYYkUxUmJYQlhVMjVWZDJJeWVESlNSRXB0VldzME0ySXpTbHBPV0U1V1pFUlNSbUV6YTNoV01VazBWREpvYUUxR1RuQlNWbVJwVWpGT1dFNVZkRXhrYTBwb1kwUmFiRnBHUlRsUVUwbHpTVzFrYzJJeVNtaGlSWFJzWlZWc2EwbHFiMmxaYlZKc1dsUlZNazVVV1hkWk1scHBUa1JPYWs5WFNYbFBSMHB0VDFSb2JGbFhUbWhhYlVVeVRrUlphV1pSUFQwaWZRPT0ifQ== diff --git a/e2e/playwright/tests/@change-license/paid-license.yaml b/e2e/playwright/tests/@change-license/paid-license.yaml new file mode 100644 index 0000000000..c7f885051a --- /dev/null +++ b/e2e/playwright/tests/@change-license/paid-license.yaml @@ -0,0 +1,23 @@ +apiVersion: kots.io/v1beta1 +kind: License +metadata: + name: change-license-paid +spec: + appSlug: change-license + channelID: 27IsVgJe0RzlGKfq9GtZWVkEorT + channelName: Automated + customerName: change-license-paid + endpoint: https://replicated.app + entitlements: + expires_at: + description: License Expiration + title: Expiration + value: "" + valueType: String + isGitOpsSupported: true + isNewKotsUiEnabled: true + isSnapshotSupported: true + licenseID: 27ItJmO939O1wUoUWmoyIG9FKPg + licenseSequence: 1 + licenseType: prod + signature: eyJsaWNlbnNlRGF0YSI6ImV5SmhjR2xXWlhKemFXOXVJam9pYTI5MGN5NXBieTkyTVdKbGRHRXhJaXdpYTJsdV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cxek1VNVZNVEpqTTBKWldWVndSazVFVVhkVVJUQjZXa1ZLZFVzeFZubFBWVXB6VkRGR1Yxa3hSazFXYWs1VllUTndObFp0U201T01FNHhaRVZvVGtzeFVsWlZXRVpxVkd0MGExWnRaSFpSYkd4clZtNUthVlZZWXpsUVUwbHpTVzFrYzJJeVNtaGlSWFJzWlZWc2EwbHFiMmxaYlZKc1dsUlZNazVVV1hkWk1scHBUa1JPYWs5WFNYbFBSMHB0VDFSb2JGbFhUbWhhYlVVeVRrUlphV1pSUFQwaWZRPT0ifQ== diff --git a/e2e/playwright/tests/@change-license/test.spec.ts b/e2e/playwright/tests/@change-license/test.spec.ts new file mode 100644 index 0000000000..7fdd4e72eb --- /dev/null +++ b/e2e/playwright/tests/@change-license/test.spec.ts @@ -0,0 +1,37 @@ +import { test, expect } from '@playwright/test'; +import { login, uploadLicense } from '../shared'; + +test('change license', async ({ page }) => { + test.slow(); + await login(page); + await uploadLicense(page, expect, "community-license.yaml"); + await expect(page.locator('#app')).toContainText('Change License', { timeout: 10000 }); + await expect(page.locator('#app')).toContainText('Ready', { timeout: 30000 }); + await expect(page.locator('#app')).toContainText('Currently deployed version'); + await page.getByRole('link', { name: 'License', exact: true }).click(); + await expect(page.locator('#app')).toContainText('change-license-community', { timeout: 10000 }); + await expect(page.locator('#app')).toContainText('Community license'); + await page.getByRole('button', { name: 'Change license' }).click(); + const changeLicenseModal = page.getByLabel('Change License'); + await expect(changeLicenseModal).toContainText('Change your license'); + await page.setInputFiles('input[type="file"]', `${process.env.TEST_PATH}/different-app-license.yaml`); + await changeLicenseModal.getByRole('button', { name: 'Change license' }).click(); + await expect(changeLicenseModal).toContainText('New license is for a different application', { timeout: 10000 }); + await page.getByText('Select a different file').click(); + await page.setInputFiles('input[type="file"]', `${process.env.TEST_PATH}/expired-license.yaml`); + await changeLicenseModal.getByRole('button', { name: 'Change license' }).click(); + await expect(changeLicenseModal).toContainText('License is expired', { timeout: 10000 }); + await page.getByText('Select a different file').click(); + await page.setInputFiles('input[type="file"]', `${process.env.TEST_PATH}/paid-license.yaml`); + await changeLicenseModal.getByRole('button', { name: 'Change license' }).click(); + await expect(page.getByLabel('Next step')).toContainText('The license for Change License has been updated.', { timeout: 10000 }); + await page.getByRole('button', { name: 'Cancel' }).click(); + await expect(page.locator('#app')).toContainText('change-license-paid'); + await expect(page.locator('#app')).toContainText('Prod license'); + await expect(page.locator('#app')).not.toContainText('change-license-community'); + await expect(page.locator('#app')).not.toContainText('Community license'); + await expect(page.getByRole('button', { name: 'Change license' })).not.toBeVisible(); + await page.getByRole('link', { name: 'Version history' }).click(); + await expect(page.locator('#app')).toContainText('License Change', { timeout: 10000 }); + await expect(page.locator('#app')).toContainText('Sequence 1'); +});