diff --git a/.gitignore b/.gitignore index 728327101da..b2e57390bbe 100644 --- a/.gitignore +++ b/.gitignore @@ -49,5 +49,6 @@ generated /reports* /data/page_views_map.json test-results +test/storage-state.json public/data \ No newline at end of file diff --git a/.teamcity/tests/buildTypes/E2EProductionTest.kt b/.teamcity/tests/buildTypes/E2EProductionTest.kt index b6f2b848bf4..797d5e22976 100644 --- a/.teamcity/tests/buildTypes/E2EProductionTest.kt +++ b/.teamcity/tests/buildTypes/E2EProductionTest.kt @@ -48,6 +48,7 @@ object E2EProductionTest : BuildType({ features { notifications { + branchFilter = "+:master" enabled = !isProjectPlayground() notifierSettings = slackNotifier { connection = "PROJECT_EXT_486" diff --git a/.teamcity/tests/buildTypes/E2ETests.kt b/.teamcity/tests/buildTypes/E2ETests.kt index 2a67494084a..e7547d32444 100644 --- a/.teamcity/tests/buildTypes/E2ETests.kt +++ b/.teamcity/tests/buildTypes/E2ETests.kt @@ -1,12 +1,9 @@ package tests.buildTypes -import documentation.builds.KotlinWithCoroutines import jetbrains.buildServer.configs.kotlin.BuildType import jetbrains.buildServer.configs.kotlin.FailureAction import jetbrains.buildServer.configs.kotlin.buildSteps.script -import kotlinlang.builds.BuildJsAssets -import references.builds.kotlinx.coroutines.KotlinxCoroutinesBuildApiReference -import references.builds.kotlinx.serialization.KotlinxSerializationBuildApiReference +import kotlinlang.builds.BuildSitePages object E2ETests : BuildType({ @@ -16,70 +13,36 @@ object E2ETests : BuildType({ +:test-results/* => test-results.zip """.trimIndent() + requirements { + exists("docker.server.version") + contains("docker.server.osType", "linux") + } + vcs { root(vcsRoots.KotlinLangOrg) } - dependencies { - artifacts(KotlinWithCoroutines) { - cleanDestination = true - artifactRules = """ - +:webHelpImages.zip!** => dist/docs/images/ - +:webHelpKR2.zip!** => dist/docs/ - """.trimIndent() - } - - dependency(BuildJsAssets) { - snapshot { - onDependencyFailure = FailureAction.FAIL_TO_START - onDependencyCancel = FailureAction.CANCEL - } - - artifacts { - artifactRules = "+:assets.zip!** => _assets/" - } - } - - dependency(KotlinxCoroutinesBuildApiReference) { - snapshot { - onDependencyFailure = FailureAction.CANCEL - onDependencyCancel = FailureAction.CANCEL - } - - artifacts { - artifactRules = "+:pages.zip!** => libs/kotlinx.coroutines/" - } - } - - dependency(KotlinxSerializationBuildApiReference) { - snapshot { - onDependencyFailure = FailureAction.CANCEL - onDependencyCancel = FailureAction.CANCEL - } - - artifacts { - artifactRules = "+:pages.zip!** => libs/kotlinx.serialization/" - } - } + params { + param("env.WEBTEAM_UI_NPM_TOKEN", "%WEBTEAM_UI_NPM_TOKEN%") } steps { - script { - name = "Set execute permissions" - scriptContent = "chmod +x ./scripts/test/run-e2e-tests.sh" - } script { name = "Run E2E tests" scriptContent = "./scripts/test/run-e2e-tests.sh" } } - artifactRules = """ - +:test-results/ => test-results/ - """.trimIndent() - - requirements { - exists("docker.server.version") - contains("docker.server.osType", "linux") + dependencies { + dependency(BuildSitePages) { + snapshot { + onDependencyFailure = FailureAction.FAIL_TO_START + onDependencyCancel = FailureAction.CANCEL + } + artifacts { + buildRule = sameChainOrLastFinished() + artifactRules = "+:pages.zip!** => dist/" + } + } } }) diff --git a/blocks/education/courses-list/courses-list.tsx b/blocks/education/courses-list/courses-list.tsx index db71c9b975d..0e39a3c59ce 100644 --- a/blocks/education/courses-list/courses-list.tsx +++ b/blocks/education/courses-list/courses-list.tsx @@ -22,14 +22,14 @@ interface CoursesListProps { export const CoursesList: FC = ({ universities }) => { const textCn = useTextStyles(); return ( -
-
+
+
University title
Location
Teaching Kotlin
{universities.map((university) => ( -
+
{university.title}
{university.location}
diff --git a/blocks/education/education-layout/education-layout.tsx b/blocks/education/education-layout/education-layout.tsx index b6db3893bfd..f2daad2827b 100644 --- a/blocks/education/education-layout/education-layout.tsx +++ b/blocks/education/education-layout/education-layout.tsx @@ -51,6 +51,7 @@ export const EducationLayout: FC = ({
{ }} > {({ setFieldValue }) => ( -
+ Subscribe form
@@ -66,12 +66,14 @@ export const SubscriptionForm: FC = () => { className={styles.input} /> - +
+ +
{isSubmitted ? ( Subscribe - + ) : ( diff --git a/blocks/education/teach-launch-course/teach-launch-course.tsx b/blocks/education/teach-launch-course/teach-launch-course.tsx index 6d2e0484a86..056b8e2d8cc 100644 --- a/blocks/education/teach-launch-course/teach-launch-course.tsx +++ b/blocks/education/teach-launch-course/teach-launch-course.tsx @@ -9,7 +9,7 @@ export const TeachLaunchCourse: FC = () => { return (
-
+
The Programming in Kotlin course is a comprehensive toolkit for teaching Kotlin and can be easily customized to align with specific educational needs. The course comes with slides, lecture notes, and assessment resources. diff --git a/blocks/education/teach-map/teach-map-marker.tsx b/blocks/education/teach-map/teach-map-marker.tsx index 43ffaea6281..a4003028116 100644 --- a/blocks/education/teach-map/teach-map-marker.tsx +++ b/blocks/education/teach-map/teach-map-marker.tsx @@ -14,7 +14,7 @@ interface TeachMapMarkerProps { export const TeachMapMarker: FC = ({ university, showTooltip, onClose }) => { return ( -
+
{showTooltip && }
); diff --git a/blocks/education/teach-map/teach-map-tooltip.tsx b/blocks/education/teach-map/teach-map-tooltip.tsx index 4f5399f3253..ee2bef1ba43 100644 --- a/blocks/education/teach-map/teach-map-tooltip.tsx +++ b/blocks/education/teach-map/teach-map-tooltip.tsx @@ -19,7 +19,7 @@ export const TeachMapTooltip: FC = ({ university, onClose ); return ( -
+
{university.title}
diff --git a/blocks/education/teach-map/teach-map.tsx b/blocks/education/teach-map/teach-map.tsx index 6f856d74d7a..48ce87ba1ce 100644 --- a/blocks/education/teach-map/teach-map.tsx +++ b/blocks/education/teach-map/teach-map.tsx @@ -32,7 +32,7 @@ export const TeachMap: FC = ({ className, universities }) => { return ( Map is unavailable
}> -
+
= ({ countriesCount, universiti
{countriesCount}
-
+
countries
@@ -21,7 +21,7 @@ export const TeachNumbers: FC = ({ countriesCount, universiti
{universitiesCount}
-
+
universities
diff --git a/docker-compose-e2e-statics.yml b/docker-compose-e2e-statics.yml index dbc43b8e4ae..eea31864af3 100644 --- a/docker-compose-e2e-statics.yml +++ b/docker-compose-e2e-statics.yml @@ -1,34 +1,30 @@ -version: '3' services: nginx-server: - build: - context: . - dockerfile: ./dockerfiles/nginx-server/Dockerfile - ports: - - 8081:80 + image: nginx:stable-alpine networks: - - network1 + - test-network + volumes: + - ./dist:/usr/share/nginx/html healthcheck: - test: [ "CMD", "curl", "-f", "http://localhost" ] - interval: 30s - timeout: 10s - retries: 3 + test: [ "CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost" ] + interval: 30s + timeout: 5s + retries: 3 playwright: - build: - context: . - dockerfile: ./dockerfiles/playwright/Dockerfile - command: yarn run test:e2e:ci + image: mcr.microsoft.com/playwright:v1.57.0-noble environment: BASE_URL: "http://nginx-server" + WEBTEAM_UI_NPM_TOKEN: ${WEBTEAM_UI_NPM_TOKEN} + working_dir: /var/www volumes: - - ./test/snapshots:/var/www/test/snapshots - - ./test-results:/var/www/test-results + - .:/var/www + command: sh -c "yarn install && yarn run test:e2e:ci" depends_on: nginx-server: condition: service_healthy networks: - - network1 + - test-network networks: - network1: + test-network: diff --git a/dockerfiles/e2e-tests/Dockerfile b/dockerfiles/e2e-tests/Dockerfile index ef90f1d9dd3..27c9f279f66 100644 --- a/dockerfiles/e2e-tests/Dockerfile +++ b/dockerfiles/e2e-tests/Dockerfile @@ -15,7 +15,7 @@ RUN npm install --global yarn # Install Playwright dependencies RUN apt-get -y install wget gnupg -RUN npx playwright@1.53.0 install-deps +RUN npx playwright@1.57 install-deps WORKDIR /var/www diff --git a/dockerfiles/nginx-server/Dockerfile b/dockerfiles/nginx-server/Dockerfile deleted file mode 100644 index 098d448db6e..00000000000 --- a/dockerfiles/nginx-server/Dockerfile +++ /dev/null @@ -1,8 +0,0 @@ -FROM nginx:latest - -WORKDIR /var/www -COPY dist /usr/share/nginx/html -COPY libs /usr/share/nginx/html/api -COPY _assets /usr/share/nginx/html/_assets - -RUN chmod -R 755 /usr/share/nginx/html diff --git a/dockerfiles/playwright/Dockerfile b/dockerfiles/playwright/Dockerfile deleted file mode 100644 index 3f5d124c5e6..00000000000 --- a/dockerfiles/playwright/Dockerfile +++ /dev/null @@ -1,13 +0,0 @@ -FROM mcr.microsoft.com/playwright:v1.53.0-noble - -WORKDIR /var/www - -COPY package.json yarn.lock ./ -RUN apt-get update && apt-get install -y build-essential -RUN yarn install --frozen-lockfile - -COPY playwright.config.js . - -COPY . . - -CMD ["tail", "-f"] diff --git a/package.json b/package.json index 7da99728ec5..f937a6ead11 100644 --- a/package.json +++ b/package.json @@ -107,6 +107,7 @@ "next-optimized-images": "3.0.0-canary.10", "next-transpile-modules": "^10.0.1", "playwright": "1.57.0", + "playwright-teamcity-reporter": "1.0.5", "postcss-custom-media": "10.0.0", "postcss-import": "15.1.0", "prettier": "2.6.2", @@ -136,11 +137,11 @@ "lint": "next lint", "test": "playwright test test", "test:production": "playwright test test/production", - "test:production:ci": "CI=true BASE_URL=https://kotlinlang.org playwright test test/production", + "test:production:ci": "CI=true BASE_URL=https://kotlinlang.org playwright test", "test:production:headed": "playwright test test/production --headed --project=chromium", "test:production:debug": "PWDEBUG=1 playwright test test/production --project=chromium", "test:e2e": "playwright test test/e2e", - "test:e2e:ci": "CI=true playwright test test/e2e", + "test:e2e:ci": "CI=true playwright test", "test:e2e:headed": "playwright test test/e2e --headed", "test:e2e:debug": "PWDEBUG=1 playwright test test/e2e --project=chromium", "test:e2e:update": "playwright test test/e2e --update-snapshots", diff --git a/pages/education/index.tsx b/pages/education/index.tsx index 4e6defab657..1631e082454 100644 --- a/pages/education/index.tsx +++ b/pages/education/index.tsx @@ -75,9 +75,9 @@ function EducationPage() {
-
+
-
+
-
+
-
+
-
+
-
-
+
+
Harvard University
-
+
University of Cambridge
-
+
Stanford University
-
+
Imperial College London
-
+
- + -
+

@@ -270,7 +270,7 @@ function EducationPage() {