Skip to content

Commit f88499b

Browse files
authored
Jakekohl/cypress-time (#12)
Send it
2 parents d7841e5 + bbed29c commit f88499b

File tree

16 files changed

+274
-183
lines changed

16 files changed

+274
-183
lines changed

.github/workflows/cypress.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Cypress Tests
2+
on: [pull_request]
3+
jobs:
4+
cypress-run:
5+
runs-on: ubuntu-latest
6+
strategy:
7+
fail-fast: false
8+
steps:
9+
- name: Checkout
10+
uses: actions/checkout@v4
11+
- name: Cypress run
12+
uses: cypress-io/github-action@v6
13+
with:
14+
start: npm run test:ci
15+
wait-on: 'http://localhost:5173'
16+
record: true
17+
parallel: true
18+
env:
19+
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
20+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

README.md

Lines changed: 32 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,52 @@
1-
# vue-project
1+
# jakekohl.github.io (aka, the Professional Portfolio that is also a sandbox)
22

3-
This template should help get you started developing with Vue 3 in Vite.
3+
Hey there! 👋
44

5-
## Recommended IDE Setup
5+
This project is my personal professional portfolio—a place to highlight my work, skills, and experience in tech. But it’s more than just a digital resume. I built this site as a hands-on sandbox for experimenting with modern web development tools, frameworks, and best practices.
66

7-
[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur).
7+
One of my main goals here is to showcase robust test automation, so you’ll find real-world implementations of both **Cypress** and **PlayWright** throughout the codebase. Whether you’re a recruiter, a fellow developer, or just curious, feel free to poke around and see how I approach building, testing, and continuously improving QA Test Automations within modern web applications!
88

9-
## Customize configuration
9+
## Current Technologies Implemented
1010

11-
See [Vite Configuration Reference](https://vite.dev/config/).
11+
This project leverages a modern web stack and several best-in-class tools:
1212

13-
## Project Setup
13+
- **Vue 3**: The core framework for building the user interface.
14+
- **PrimeVue**: A rich UI component library for Vue, used extensively for layout and interactive elements.
15+
- **Cypress**: End-to-end and component testing framework, with custom commands and workflows implemented.
16+
- **Playwright**: Planned for future implementation as an additional E2E testing solution.
17+
- **Vite**: Lightning-fast build tool and development server.
18+
- **Other Node Packages**: For a full list of dependencies and devDependencies, see the [package.json](./package.json).
1419

15-
```sh
16-
npm install
17-
```
18-
19-
### Compile and Hot-Reload for Development
20+
You’ll find these technologies reflected throughout the codebase, with more details and specific versions in the [package.json](./package.json).
2021

21-
```sh
22-
npm run dev
23-
```
2422

25-
### Compile and Minify for Production
23+
## Cypress & Playwright
2624

27-
```sh
28-
npm run build
29-
```
25+
### Current Test Results
26+
Cypress Cloud Results can be found here, where you can see history of runs through local development and from the CI/CD Pipeline
27+
[![jakekohl.github.io](https://img.shields.io/endpoint?url=https://cloud.cypress.io/badge/detailed/kz76nf&style=for-the-badge&logo=cypress)](https://cloud.cypress.io/projects/kz76nf/runs)
3028

31-
### Run Headed Component Tests with [Cypress Component Testing](https://on.cypress.io/component)
3229

33-
```sh
34-
npm run test:unit:dev # or `npm run test:unit` for headless testing
35-
```
30+
### Running Cypress Tests
3631

37-
### Run End-to-End Tests with [Cypress](https://www.cypress.io/)
32+
You can run the Cypress test suite against the deployed site (`https://jakekohl.github.io`) or locally after cloning the repository. Below are step-by-step instructions for both approaches.
3833

39-
```sh
40-
npm run test:e2e:dev
4134
```
35+
# Clone this repo
36+
git clone https://github.com/jakekohl/jakekohl.github.io
4237
43-
This runs the end-to-end tests against the Vite development server.
44-
It is much faster than the production build.
45-
46-
But it's still recommended to test the production build with `test:e2e` before deploying (e.g. in CI environments):
38+
# Install packages
39+
npm i
4740
48-
```sh
49-
npm run build
50-
npm run test:e2e
51-
```
41+
# Run Cypress locally against the deployed site
42+
npx cypress run --config baseUrl=https://jakekohl.github.io
5243
53-
### Lint with [ESLint](https://eslint.org/)
44+
# Or open the Cypress UI with the deployed site as baseUrl
45+
npx cypress open --config baseUrl=https://jakekohl.github.io
5446
55-
```sh
56-
npm run lint
47+
# If you want to run this locally, you can run the source code locally and run Cypress locally
48+
npm run dev && npm run cy:open
5749
```
50+
51+
### Running Playwright Test Automations
52+
`Coming Soon`

cypress.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { defineConfig } from 'cypress'
22

33
export default defineConfig({
4+
projectId: 'kz76nf',
45
e2e: {
56
specPattern: 'cypress/e2e/**/*.{cy,spec}.{js,jsx,ts,tsx}',
6-
baseUrl: 'http://localhost:4173',
7+
baseUrl: 'http://localhost:5173',
78
},
89
component: {
910
specPattern: 'src/**/__tests__/*.{cy,spec}.{js,ts,jsx,tsx}',

cypress/e2e/example.cy.js

Lines changed: 0 additions & 8 deletions
This file was deleted.

cypress/e2e/workflow/home.cy.js

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
describe('Home Page', () => {
2+
3+
beforeEach(() => {
4+
cy.visit('/');
5+
});
6+
7+
it('should display the home page with the Top Navigation Menubar', () => {
8+
const brandText = 'Jake Kohl';
9+
const menuItems = [
10+
{ dataTest: 'nav-home', label: 'Home' },
11+
{ dataTest: 'nav-projects', label: 'Projects' },
12+
{ dataTest: 'nav-contact', label: 'Contact' },
13+
];
14+
const socialLinks = [
15+
{ dataTest: 'social-github', link: 'https://github.com/jakekohl' },
16+
{ dataTest: 'social-linkedin', link: 'https://linkedin.com/in/jacob-jp-kohl' },
17+
];
18+
const sections = [ 'hero-section', 'stats-section', 'skills-section', 'cta-section' ];
19+
cy.verifyTopNavMenubar(brandText, menuItems, socialLinks);
20+
sections.forEach((section) => {
21+
cy.verifySectionVisibility(section);
22+
});
23+
});
24+
25+
it('should inform the user whose portfolio they are looking at', () => {
26+
cy.getDataTest('hero-section').should('be.visible').within(() => {
27+
cy.contains('Jake Kohl').should('be.visible');
28+
cy.contains('Quality Assurance Engineer').should('be.visible');
29+
cy.contains('Test Automation Enthusiast').should('be.visible');
30+
cy.getDataTest('profile-avatar').should('be.visible').children().should('have.attr', 'src').and('include', 'https://avatars.githubusercontent.com/');
31+
});
32+
});
33+
34+
it('should allow user to navigate to the projects page through the hero section', () => {
35+
cy.getDataTest('hero-section').should('be.visible').within(() => {
36+
cy.clickDataTest('hero-projects-button');
37+
});
38+
cy.url().should('include', '/projects');
39+
});
40+
41+
it.skip('should allow a user to directly download a resume from the hero section', () => {
42+
cy.getDataTest('hero-section').should('be.visible').within(() => {
43+
cy.clickDataTest('hero-resume-button');
44+
});
45+
});
46+
47+
it('should showcase the user\'s years of experience in different domains', () => {
48+
const stats = [
49+
{
50+
dataTest: 'quality-assurance',
51+
value: 5,
52+
label: 'Quality Assurance',
53+
},
54+
{
55+
dataTest: 'technical-support',
56+
value: 8,
57+
label: 'Technical Support',
58+
},
59+
{
60+
dataTest: 'technical-leadership',
61+
value: 4,
62+
label: 'Technical Leadership',
63+
},
64+
{
65+
dataTest: 'management',
66+
value: 1,
67+
label: 'Management',
68+
},
69+
{
70+
dataTest: 'software-development',
71+
value: 3,
72+
label: 'Software Development',
73+
},
74+
{
75+
dataTest: 'infrastructure',
76+
value: 6,
77+
label: 'Infrastructure',
78+
},
79+
];
80+
cy.getDataTest('stats-section').should('be.visible').within(() => {
81+
cy.contains('Professional Experience (Years)').should('be.visible');
82+
cy.verifyProfessionalStats(stats);
83+
});
84+
});
85+
86+
it('should showcase the user\'s technical skills in high level categories', () => {
87+
const categories = ['development', 'testing', 'infrastructure', 'support', 'soft-skills'];
88+
categories.forEach((category) => {
89+
cy.getDataTest(`skill-domain-${category}`).should('be.visible');
90+
});
91+
});
92+
93+
it('should show a call-to-action featuring a button link for connecting with the user', () => {
94+
cy.getDataTest('cta-section').should('be.visible').within(() => {
95+
cy.clickDataTest('contact-cta-button');
96+
cy.url().should('include', '/contact');
97+
});
98+
});
99+
});

cypress/support/commands.js

Lines changed: 0 additions & 25 deletions
This file was deleted.

cypress/support/commands/home.js

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/**
2+
* Verify the top navigation menubar
3+
* @param {string} brandText - The text for the brand slot
4+
* @param {Object[]} menuItems - The menu items to verify
5+
* @param {Object[]} socialLinks - The social links to verify
6+
*/
7+
Cypress.Commands.add('verifyTopNavMenubar', (brandText, menuItems, socialLinks) => {
8+
cy.getDataTest('nav-top-menubar').should('exist').should('be.visible').within(() => {
9+
cy.getDataTest('brand-slot').should('exist').should('be.visible').should('have.text', brandText);
10+
menuItems.forEach((item) => {
11+
cy.getDataTest(item.dataTest).should('exist').should('be.visible').should('have.text', item.label);
12+
});
13+
socialLinks.forEach((link) => {
14+
cy.getDataTest(link.dataTest).should('exist').should('be.visible').should('have.attr', 'href', link.link);
15+
});
16+
});
17+
});
18+
19+
/**
20+
* Verify the visibility of a section
21+
* @param {string} sectionSelector - The selector for the section
22+
*/
23+
Cypress.Commands.add('verifySectionVisibility', (sectionSelector) => {
24+
cy.getDataTest(sectionSelector).should('exist').should('be.visible');
25+
});
26+
27+
/**
28+
* Verify the professional stats
29+
* @param {Object[]} stats - The stats to verify
30+
* @param {string} stats.dataTest - The data test for the stat
31+
* @param {string} stats.value - The value for the stat
32+
* @param {string} stats.label - The label for the stat
33+
*/
34+
Cypress.Commands.add('verifyProfessionalStats', (stats) => {
35+
stats.forEach((stat) => {
36+
cy.getDataTest(`stat-${stat.dataTest}`).should('be.visible').should('contain', stat.value).should('contain', stat.label);
37+
});
38+
});

cypress/support/component-index.html

Lines changed: 0 additions & 12 deletions
This file was deleted.

cypress/support/component.js

Lines changed: 0 additions & 30 deletions
This file was deleted.

cypress/support/e2e.js

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,5 @@
1-
// ***********************************************************
2-
// This example support/index.js is processed and
3-
// loaded automatically before your test files.
4-
//
5-
// This is a great place to put global configuration and
6-
// behavior that modifies Cypress.
7-
//
8-
// You can change the location of this file or turn off
9-
// automatically serving support files with the
10-
// 'supportFile' configuration option.
11-
//
12-
// You can read more here:
13-
// https://on.cypress.io/configuration
14-
// ***********************************************************
1+
// General Helper Files
2+
import './helpers/general.js'
153

16-
// Import commands.js using ES2015 syntax:
17-
import './commands'
18-
19-
// Alternatively you can use CommonJS syntax:
20-
// require('./commands')
4+
// E2E Command Files
5+
import './commands/home.js'

0 commit comments

Comments
 (0)