Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
name: End-to-end Tests
on:
push:
branches: [main, develop]
branches: [main, develop, prod]
pull_request:
branches: [main, develop]
branches: [main, develop, prod]
jobs:
e2e:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v6
- name: Prepare .env file
run: |
rm -f .env && touch .env
echo "NEXT_PUBLIC_FORMSPREE_ID=fake123" >> .env
echo "NEXT_PUBLIC_RECAPTCHA_SITE_KEY=123fAkE" >> .env
- uses: actions/setup-node@v3
- uses: actions/setup-node@v6
with:
node-version: '18.x'
node-version: '24.x'
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: npm run test
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v5
if: always()
with:
name: playwright-report
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
name: Lint, Format and Build
on:
push:
branches: [main, develop]
branches: [main, develop, prod]
pull_request:
branches: [main, develop]
branches: [main, develop, prod]
jobs:
validate:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: '14.x'
node-version: '24.x'
- name: Install dependencies
run: npm ci
- name: Run code validation (includes linting, prettier and building)
Expand Down
1 change: 0 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ Please note we have a [code of conduct](https://github.com/reactdeveloperske/rea
If you're ready to contribute and create your PR, it will help to set up a local environment so you can see your changes.

1. Set up your development environment

- install your favorite text editor/IDE
- install [Nodejs](nodejs.org)

Expand Down
2 changes: 1 addition & 1 deletion e2e/events.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ test.describe('Test if see more link is clickable', () => {
const [newPage] = await Promise.all([
context.waitForEvent('page'),
page.waitForLoadState(),
page.getByRole('link', { name: 'See More' }).click(),
page.getByRole('link', { name: 'See More Events' }).click(),
]);
await expect(newPage).toHaveURL(
'https://kommunity.com/reactjs-developer-community-kenya-reactdevske/events'
Expand Down
20 changes: 8 additions & 12 deletions e2e/hero-header.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { test, expect } from '@playwright/test';
import { expect, test } from '@playwright/test';

test.beforeEach(async ({ page }) => {
page.goto('http://localhost:3000');
Expand All @@ -8,12 +8,12 @@
test('About us link should navigate to about us section', async ({
page,
}) => {
await page.getByRole('link', { name: 'About us' }).click();

Check failure on line 11 in e2e/hero-header.spec.ts

View workflow job for this annotation

GitHub Actions / e2e

[chromium] › e2e/hero-header.spec.ts:8:7 › Test Hero Header Navigation Links › About us link should navigate to about us section

1) [chromium] › e2e/hero-header.spec.ts:8:7 › Test Hero Header Navigation Links › About us link should navigate to about us section Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── Error: locator.click: Test timeout of 30000ms exceeded. Call log: - waiting for getByRole('link', { name: 'About us' }) - waiting for" http://localhost:3000/" navigation to finish... - navigated to "http://localhost:3000/" - locator resolved to <a href="#about-us">…</a> - attempting click action 2 × waiting for element to be visible, enabled and stable - element is visible, enabled and stable - scrolling into view if needed - done scrolling - <div class="w-full flex py-20 flex-col items-center justify-center relative z-10">…</div> from <div id="hero" class="pt-2 bg-[#060b17]">…</div> subtree intercepts pointer events - retrying click action - waiting 20ms 2 × waiting for element to be visible, enabled and stable - element is visible, enabled and stable - scrolling into view if needed - done scrolling - <div class="w-full flex py-20 flex-col items-center justify-center relative z-10">…</div> from <div id="hero" class="pt-2 bg-[#060b17]">…</div> subtree intercepts pointer events - retrying click action - waiting 100ms 54 × waiting for element to be visible, enabled and stable - element is visible, enabled and stable - scrolling into view if needed - done scrolling - <div class="w-full flex py-20 flex-col items-center justify-center relative z-10">…</div> from <div id="hero" class="pt-2 bg-[#060b17]">…</div> subtree intercepts pointer events - retrying click action - waiting 500ms - waiting for element to be visible, enabled and stable - element is visible, enabled and stable - scrolling into view if needed 9 | page, 10 | }) => { > 11 | await page.getByRole('link', { name: 'About us' }).click(); | ^ 12 | await expect(page).toHaveURL('/#about-us'); 13 | }); 14 | at /home/runner/work/reactdevske-website/reactdevske-website/e2e/hero-header.spec.ts:11:56

Check failure on line 11 in e2e/hero-header.spec.ts

View workflow job for this annotation

GitHub Actions / e2e

[chromium] › e2e/hero-header.spec.ts:8:7 › Test Hero Header Navigation Links › About us link should navigate to about us section

1) [chromium] › e2e/hero-header.spec.ts:8:7 › Test Hero Header Navigation Links › About us link should navigate to about us section Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: locator.click: Test timeout of 30000ms exceeded. Call log: - waiting for getByRole('link', { name: 'About us' }) - waiting for" http://localhost:3000/" navigation to finish... - navigated to "http://localhost:3000/" - locator resolved to <a href="#about-us">…</a> - attempting click action 2 × waiting for element to be visible, enabled and stable - element is visible, enabled and stable - scrolling into view if needed - done scrolling - <div class="w-full flex py-20 flex-col items-center justify-center relative z-10">…</div> from <div id="hero" class="pt-2 bg-[#060b17]">…</div> subtree intercepts pointer events - retrying click action - waiting 20ms 2 × waiting for element to be visible, enabled and stable - element is visible, enabled and stable - scrolling into view if needed - done scrolling - <div class="w-full flex py-20 flex-col items-center justify-center relative z-10">…</div> from <div id="hero" class="pt-2 bg-[#060b17]">…</div> subtree intercepts pointer events - retrying click action - waiting 100ms 56 × waiting for element to be visible, enabled and stable - element is visible, enabled and stable - scrolling into view if needed - done scrolling - <div class="w-full flex py-20 flex-col items-center justify-center relative z-10">…</div> from <div id="hero" class="pt-2 bg-[#060b17]">…</div> subtree intercepts pointer events - retrying click action - waiting 500ms 9 | page, 10 | }) => { > 11 | await page.getByRole('link', { name: 'About us' }).click(); | ^ 12 | await expect(page).toHaveURL('/#about-us'); 13 | }); 14 | at /home/runner/work/reactdevske-website/reactdevske-website/e2e/hero-header.spec.ts:11:56

Check failure on line 11 in e2e/hero-header.spec.ts

View workflow job for this annotation

GitHub Actions / e2e

[chromium] › e2e/hero-header.spec.ts:8:7 › Test Hero Header Navigation Links › About us link should navigate to about us section

1) [chromium] › e2e/hero-header.spec.ts:8:7 › Test Hero Header Navigation Links › About us link should navigate to about us section Error: locator.click: Test timeout of 30000ms exceeded. Call log: - waiting for getByRole('link', { name: 'About us' }) - waiting for" http://localhost:3000/" navigation to finish... - navigated to "http://localhost:3000/" - locator resolved to <a href="#about-us">…</a> - attempting click action 2 × waiting for element to be visible, enabled and stable - element is visible, enabled and stable - scrolling into view if needed - done scrolling - <div class="w-full flex py-20 flex-col items-center justify-center relative z-10">…</div> from <div id="hero" class="pt-2 bg-[#060b17]">…</div> subtree intercepts pointer events - retrying click action - waiting 20ms 2 × waiting for element to be visible, enabled and stable - element is visible, enabled and stable - scrolling into view if needed - done scrolling - <div class="w-full flex py-20 flex-col items-center justify-center relative z-10">…</div> from <div id="hero" class="pt-2 bg-[#060b17]">…</div> subtree intercepts pointer events - retrying click action - waiting 100ms 55 × waiting for element to be visible, enabled and stable - element is visible, enabled and stable - scrolling into view if needed - done scrolling - <div class="w-full flex py-20 flex-col items-center justify-center relative z-10">…</div> from <div id="hero" class="pt-2 bg-[#060b17]">…</div> subtree intercepts pointer events - retrying click action - waiting 500ms 9 | page, 10 | }) => { > 11 | await page.getByRole('link', { name: 'About us' }).click(); | ^ 12 | await expect(page).toHaveURL('/#about-us'); 13 | }); 14 | at /home/runner/work/reactdevske-website/reactdevske-website/e2e/hero-header.spec.ts:11:56
await expect(page).toHaveURL('/#about-us');
});

test('Events link should navigate to Events section', async ({ page }) => {
await page.getByRole('link', { name: 'Events' }).click();
await page.getByRole('link', { name: 'Events', exact: true }).click();

Check failure on line 16 in e2e/hero-header.spec.ts

View workflow job for this annotation

GitHub Actions / e2e

[chromium] › e2e/hero-header.spec.ts:15:7 › Test Hero Header Navigation Links › Events link should navigate to Events section

2) [chromium] › e2e/hero-header.spec.ts:15:7 › Test Hero Header Navigation Links › Events link should navigate to Events section Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: locator.click: Test timeout of 30000ms exceeded. Call log: - waiting for getByRole('link', { name: 'Events', exact: true }) - waiting for" http://localhost:3000/" navigation to finish... - navigated to "http://localhost:3000/" - locator resolved to <a href="#events">…</a> - attempting click action 2 × waiting for element to be visible, enabled and stable - element is visible, enabled and stable - scrolling into view if needed - done scrolling - <div class="w-full flex py-20 flex-col items-center justify-center relative z-10">…</div> from <div id="hero" class="pt-2 bg-[#060b17]">…</div> subtree intercepts pointer events - retrying click action - waiting 20ms 2 × waiting for element to be visible, enabled and stable - element is visible, enabled and stable - scrolling into view if needed - done scrolling - <div class="w-full flex py-20 flex-col items-center justify-center relative z-10">…</div> from <div id="hero" class="pt-2 bg-[#060b17]">…</div> subtree intercepts pointer events - retrying click action - waiting 100ms 56 × waiting for element to be visible, enabled and stable - element is visible, enabled and stable - scrolling into view if needed - done scrolling - <div class="w-full flex py-20 flex-col items-center justify-center relative z-10">…</div> from <div id="hero" class="pt-2 bg-[#060b17]">…</div> subtree intercepts pointer events - retrying click action - waiting 500ms 14 | 15 | test('Events link should navigate to Events section', async ({ page }) => { > 16 | await page.getByRole('link', { name: 'Events', exact: true }).click(); | ^ 17 | await expect(page).toHaveURL('/#events'); 18 | }); 19 | at /home/runner/work/reactdevske-website/reactdevske-website/e2e/hero-header.spec.ts:16:67

Check failure on line 16 in e2e/hero-header.spec.ts

View workflow job for this annotation

GitHub Actions / e2e

[chromium] › e2e/hero-header.spec.ts:15:7 › Test Hero Header Navigation Links › Events link should navigate to Events section

2) [chromium] › e2e/hero-header.spec.ts:15:7 › Test Hero Header Navigation Links › Events link should navigate to Events section Error: locator.click: Test timeout of 30000ms exceeded. Call log: - waiting for getByRole('link', { name: 'Events', exact: true }) - waiting for" http://localhost:3000/" navigation to finish... - navigated to "http://localhost:3000/" - locator resolved to <a href="#events">…</a> - attempting click action 2 × waiting for element to be visible, enabled and stable - element is visible, enabled and stable - scrolling into view if needed - done scrolling - <div class="w-full flex py-20 flex-col items-center justify-center relative z-10">…</div> from <div id="hero" class="pt-2 bg-[#060b17]">…</div> subtree intercepts pointer events - retrying click action - waiting 20ms 2 × waiting for element to be visible, enabled and stable - element is visible, enabled and stable - scrolling into view if needed - done scrolling - <div class="w-full flex py-20 flex-col items-center justify-center relative z-10">…</div> from <div id="hero" class="pt-2 bg-[#060b17]">…</div> subtree intercepts pointer events - retrying click action - waiting 100ms 54 × waiting for element to be visible, enabled and stable - element is visible, enabled and stable - scrolling into view if needed - done scrolling - <div class="w-full flex py-20 flex-col items-center justify-center relative z-10">…</div> from <div id="hero" class="pt-2 bg-[#060b17]">…</div> subtree intercepts pointer events - retrying click action - waiting 500ms - waiting for element to be visible, enabled and stable 14 | 15 | test('Events link should navigate to Events section', async ({ page }) => { > 16 | await page.getByRole('link', { name: 'Events', exact: true }).click(); | ^ 17 | await expect(page).toHaveURL('/#events'); 18 | }); 19 | at /home/runner/work/reactdevske-website/reactdevske-website/e2e/hero-header.spec.ts:16:67
await expect(page).toHaveURL('/#events');
});

Expand All @@ -33,11 +33,9 @@
page.waitForLoadState(),
page.getByRole('link', { name: 'Join Community' }).click(),
]);
await expect(newPage).toHaveURL(
new RegExp(
'^https://docs.google.com/forms/d/e/1FAIpQLSc_k5sffFTeL9oDug41nXU4Spw5cV84ExaL3jNFu_I1FTZO1w/viewform'
)
);
await newPage.waitForLoadState('load');
// Accept either the shortlink (bit.ly) or the final Google Forms URL
expect(newPage.url()).toMatch(/^(https:\/\/)?(bit\.ly|docs\.google\.com)/);
});

test('Join ReactDevsKe link should open google form in new tab', async ({
Expand All @@ -49,10 +47,8 @@
page.waitForLoadState(),
page.getByRole('link', { name: 'Join ReactDevsKe' }).click(),
]);
await expect(newPage).toHaveURL(
new RegExp(
'^https://docs.google.com/forms/d/e/1FAIpQLSc_k5sffFTeL9oDug41nXU4Spw5cV84ExaL3jNFu_I1FTZO1w/viewform'
)
);
await newPage.waitForLoadState('load');
// Accept either the shortlink (bit.ly) or the final Google Forms URL
expect(newPage.url()).toMatch(/^(https:\/\/)?(bit\.ly|docs\.google\.com)/);
});
});
16 changes: 16 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import nextVitals from 'eslint-config-next/core-web-vitals';
import { defineConfig, globalIgnores } from 'eslint/config';

const eslintConfig = defineConfig([
...nextVitals,
// Override default ignores of eslint-config-next.
globalIgnores([
// Default ignores of eslint-config-next:
'.next/**',
'out/**',
'build/**',
'next-env.d.ts',
]),
]);

export default eslintConfig;
3 changes: 2 additions & 1 deletion next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
import './.next/types/routes.d.ts';

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
// see https://nextjs.org/docs/pages/api-reference/config/typescript for more information.
16 changes: 12 additions & 4 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,19 @@
const nextConfig = {
reactStrictMode: true,
pageExtensions: ['page.tsx', 'api.ts'],
eslint: {
dirs: ['src', 'e2e'],
},
images: {
domains: ['bit.ly', 'res.cloudinary.com'],
remotePatterns: [
{
protocol: 'https',
hostname: 'bit.ly',
pathname: '/:path*',
},
{
protocol: 'https',
hostname: 'res.cloudinary.com',
pathname: '/:path*',
},
],
},
};

Expand Down
Loading
Loading