Skip to content

Commit

Permalink
Merge branch '3.x' into task-4593-bump-webdriverio
Browse files Browse the repository at this point in the history
  • Loading branch information
thomashohn committed Dec 18, 2024
2 parents 8fc1284 + 1769ec0 commit 0909608
Show file tree
Hide file tree
Showing 4 changed files with 307 additions and 55 deletions.
220 changes: 187 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@




[<img src="https://img.shields.io/badge/[email protected]?logo=slack">](https://join.slack.com/t/codeceptjs/shared_invite/enQtMzA5OTM4NDM2MzA4LWE4MThhN2NmYTgxNTU5MTc4YzAyYWMwY2JkMmZlYWI5MWQ2MDM5MmRmYzZmYmNiNmY5NTAzM2EwMGIwOTNhOGQ) [<img src="https://img.shields.io/badge/discourse-codeceptjs-purple">](https://codecept.discourse.group) [![NPM version][npm-image]][npm-url] [<img src="https://img.shields.io/badge/dockerhub-images-blue.svg?logo=codeceptjs">](https://hub.docker.com/r/codeceptjs/codeceptjs)
[![AI features](https://img.shields.io/badge/AI-features?logo=openai&logoColor=white)](https://github.com/codeceptjs/CodeceptJS/edit/3.x/docs/ai.md) [![StandWithUkraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/badges/StandWithUkraine.svg)](https://github.com/vshymanskyy/StandWithUkraine/blob/main/docs/README.md)

Expand Down Expand Up @@ -292,39 +293,192 @@ When using Typescript, replace `module.exports` with `export` for autocompletion

## Contributors

Thanks all to those who are and will have contributing to this awesome project!

[//]: contributor-faces
<a href="https://github.com/DavertMik"><img src="https://avatars.githubusercontent.com/u/220264?v=4" title="DavertMik" width="80" height="80"></a>
<a href="https://github.com/kobenguyent"><img src="https://avatars.githubusercontent.com/u/7845001?v=4" title="kobenguyent" width="80" height="80"></a>
<a href="https://github.com/Vorobeyko"><img src="https://avatars.githubusercontent.com/u/11293201?v=4" title="Vorobeyko" width="80" height="80"></a>
<a href="https://github.com/reubenmiller"><img src="https://avatars.githubusercontent.com/u/3029781?v=4" title="reubenmiller" width="80" height="80"></a>
<a href="https://github.com/Arhell"><img src="https://avatars.githubusercontent.com/u/26163841?v=4" title="Arhell" width="80" height="80"></a>
<a href="https://github.com/APshenkin"><img src="https://avatars.githubusercontent.com/u/14344430?v=4" title="APshenkin" width="80" height="80"></a>
<a href="https://github.com/fabioel"><img src="https://avatars.githubusercontent.com/u/9824235?v=4" title="fabioel" width="80" height="80"></a>
<a href="https://github.com/pablopaul"><img src="https://avatars.githubusercontent.com/u/635526?v=4" title="pablopaul" width="80" height="80"></a>
<a href="https://github.com/mirao"><img src="https://avatars.githubusercontent.com/u/12584138?v=4" title="mirao" width="80" height="80"></a>
<a href="https://github.com/Georgegriff"><img src="https://avatars.githubusercontent.com/u/9056958?v=4" title="Georgegriff" width="80" height="80"></a>
<a href="https://github.com/KMKoushik"><img src="https://avatars.githubusercontent.com/u/24666922?v=4" title="KMKoushik" width="80" height="80"></a>
<a href="https://github.com/nikocanvacom"><img src="https://avatars.githubusercontent.com/u/83254493?v=4" title="nikocanvacom" width="80" height="80"></a>
<a href="https://github.com/elukoyanov"><img src="https://avatars.githubusercontent.com/u/11647141?v=4" title="elukoyanov" width="80" height="80"></a>
<a href="https://github.com/gkushang"><img src="https://avatars.githubusercontent.com/u/3663389?v=4" title="gkushang" width="80" height="80"></a>
<a href="https://github.com/tsuemura"><img src="https://avatars.githubusercontent.com/u/17092259?v=4" title="tsuemura" width="80" height="80"></a>
<a href="https://github.com/EgorBodnar"><img src="https://avatars.githubusercontent.com/u/63167966?v=4" title="EgorBodnar" width="80" height="80"></a>
<a href="https://github.com/VikalpP"><img src="https://avatars.githubusercontent.com/u/11846339?v=4" title="VikalpP" width="80" height="80"></a>
<a href="https://github.com/thomashohn"><img src="https://avatars.githubusercontent.com/u/3414869?v=4" title="thomashohn" width="80" height="80"></a>
<a href="https://github.com/elaichenkov"><img src="https://avatars.githubusercontent.com/u/29764053?v=4" title="elaichenkov" width="80" height="80"></a>
<a href="https://github.com/BorisOsipov"><img src="https://avatars.githubusercontent.com/u/6514276?v=4" title="BorisOsipov" width="80" height="80"></a>
<a href="https://github.com/ngraf"><img src="https://avatars.githubusercontent.com/u/7094389?v=4" title="ngraf" width="80" height="80"></a>
<a href="https://github.com/nitschSB"><img src="https://avatars.githubusercontent.com/u/39341455?v=4" title="nitschSB" width="80" height="80"></a>
<a href="https://github.com/hubidu"><img src="https://avatars.githubusercontent.com/u/13134082?v=4" title="hubidu" width="80" height="80"></a>
<a href="https://github.com/jploskonka"><img src="https://avatars.githubusercontent.com/u/669483?v=4" title="jploskonka" width="80" height="80"></a>
<a href="https://github.com/maojunxyz"><img src="https://avatars.githubusercontent.com/u/28778042?v=4" title="maojunxyz" width="80" height="80"></a>
<a href="https://github.com/abhimanyupandian"><img src="https://avatars.githubusercontent.com/u/36107381?v=4" title="abhimanyupandian" width="80" height="80"></a>
<a href="https://github.com/martomo"><img src="https://avatars.githubusercontent.com/u/1850135?v=4" title="martomo" width="80" height="80"></a>
<a href="https://github.com/hatufacci"><img src="https://avatars.githubusercontent.com/u/4963181?v=4" title="hatufacci" width="80" height="80"></a>

[//]: contributor-faces








<table>
<tr>
<td align="center">
<a href="https://github.com/DavertMik">
<img src="https://avatars.githubusercontent.com/u/220264?v=4" width="100" height="100" alt="DavertMik"/><br />
<sub><b>DavertMik</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/kobenguyent">
<img src="https://avatars.githubusercontent.com/u/7845001?v=4" width="100" height="100" alt="kobenguyent"/><br />
<sub><b>kobenguyent</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/Vorobeyko">
<img src="https://avatars.githubusercontent.com/u/11293201?v=4" width="100" height="100" alt="Vorobeyko"/><br />
<sub><b>Vorobeyko</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/reubenmiller">
<img src="https://avatars.githubusercontent.com/u/3029781?v=4" width="100" height="100" alt="reubenmiller"/><br />
<sub><b>reubenmiller</b></sub>
</a>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/Arhell">
<img src="https://avatars.githubusercontent.com/u/26163841?v=4" width="100" height="100" alt="Arhell"/><br />
<sub><b>Arhell</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/APshenkin">
<img src="https://avatars.githubusercontent.com/u/14344430?v=4" width="100" height="100" alt="APshenkin"/><br />
<sub><b>APshenkin</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/fabioel">
<img src="https://avatars.githubusercontent.com/u/9824235?v=4" width="100" height="100" alt="fabioel"/><br />
<sub><b>fabioel</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/pablopaul">
<img src="https://avatars.githubusercontent.com/u/635526?v=4" width="100" height="100" alt="pablopaul"/><br />
<sub><b>pablopaul</b></sub>
</a>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/mirao">
<img src="https://avatars.githubusercontent.com/u/12584138?v=4" width="100" height="100" alt="mirao"/><br />
<sub><b>mirao</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/Georgegriff">
<img src="https://avatars.githubusercontent.com/u/9056958?v=4" width="100" height="100" alt="Georgegriff"/><br />
<sub><b>Georgegriff</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/KMKoushik">
<img src="https://avatars.githubusercontent.com/u/24666922?v=4" width="100" height="100" alt="KMKoushik"/><br />
<sub><b>KMKoushik</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/nikocanvacom">
<img src="https://avatars.githubusercontent.com/u/83254493?v=4" width="100" height="100" alt="nikocanvacom"/><br />
<sub><b>nikocanvacom</b></sub>
</a>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/elukoyanov">
<img src="https://avatars.githubusercontent.com/u/11647141?v=4" width="100" height="100" alt="elukoyanov"/><br />
<sub><b>elukoyanov</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/thomashohn">
<img src="https://avatars.githubusercontent.com/u/3414869?v=4" width="100" height="100" alt="thomashohn"/><br />
<sub><b>thomashohn</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/gkushang">
<img src="https://avatars.githubusercontent.com/u/3663389?v=4" width="100" height="100" alt="gkushang"/><br />
<sub><b>gkushang</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/tsuemura">
<img src="https://avatars.githubusercontent.com/u/17092259?v=4" width="100" height="100" alt="tsuemura"/><br />
<sub><b>tsuemura</b></sub>
</a>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/EgorBodnar">
<img src="https://avatars.githubusercontent.com/u/63167966?v=4" width="100" height="100" alt="EgorBodnar"/><br />
<sub><b>EgorBodnar</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/VikalpP">
<img src="https://avatars.githubusercontent.com/u/11846339?v=4" width="100" height="100" alt="VikalpP"/><br />
<sub><b>VikalpP</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/elaichenkov">
<img src="https://avatars.githubusercontent.com/u/29764053?v=4" width="100" height="100" alt="elaichenkov"/><br />
<sub><b>elaichenkov</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/BorisOsipov">
<img src="https://avatars.githubusercontent.com/u/6514276?v=4" width="100" height="100" alt="BorisOsipov"/><br />
<sub><b>BorisOsipov</b></sub>
</a>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/ngraf">
<img src="https://avatars.githubusercontent.com/u/7094389?v=4" width="100" height="100" alt="ngraf"/><br />
<sub><b>ngraf</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/nitschSB">
<img src="https://avatars.githubusercontent.com/u/39341455?v=4" width="100" height="100" alt="nitschSB"/><br />
<sub><b>nitschSB</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/hubidu">
<img src="https://avatars.githubusercontent.com/u/13134082?v=4" width="100" height="100" alt="hubidu"/><br />
<sub><b>hubidu</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/jploskonka">
<img src="https://avatars.githubusercontent.com/u/669483?v=4" width="100" height="100" alt="jploskonka"/><br />
<sub><b>jploskonka</b></sub>
</a>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/maojunxyz">
<img src="https://avatars.githubusercontent.com/u/28778042?v=4" width="100" height="100" alt="maojunxyz"/><br />
<sub><b>maojunxyz</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/abhimanyupandian">
<img src="https://avatars.githubusercontent.com/u/36107381?v=4" width="100" height="100" alt="abhimanyupandian"/><br />
<sub><b>abhimanyupandian</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/martomo">
<img src="https://avatars.githubusercontent.com/u/1850135?v=4" width="100" height="100" alt="martomo"/><br />
<sub><b>martomo</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/hatufacci">
<img src="https://avatars.githubusercontent.com/u/4963181?v=4" width="100" height="100" alt="hatufacci"/><br />
<sub><b>hatufacci</b></sub>
</a>
</td></tr>
</table>


## License

Expand Down
45 changes: 44 additions & 1 deletion lib/plugin/stepByStepReport.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const figures = require('figures')
const fs = require('fs')
const mkdirp = require('mkdirp')
const path = require('path')
const cheerio = require('cheerio')

const Container = require('../container')
const recorder = require('../recorder')
Expand Down Expand Up @@ -133,7 +134,49 @@ module.exports = function (config) {

event.dispatcher.on(event.all.result, () => {
if (Object.keys(recordedTests).length === 0 || !Object.keys(slides).length) return
generateRecordsHtml(recordedTests)
})

event.dispatcher.on(event.workers.result, async () => {
await recorder.add(() => {
const recordedTests = getRecordFoldersWithDetails(reportDir)
generateRecordsHtml(recordedTests)
})
})

function getRecordFoldersWithDetails(dirPath) {
let results = {}

try {
const items = fs.readdirSync(dirPath, { withFileTypes: true })

items.forEach((item) => {
if (item.isDirectory() && item.name.startsWith('record_')) {
const recordFolderPath = path.join(dirPath, item.name)
const indexPath = path.join(recordFolderPath, 'index.html')

let name = ''
if (fs.existsSync(indexPath)) {
try {
const htmlContent = fs.readFileSync(indexPath, 'utf-8')
const $ = cheerio.load(htmlContent)
name = $('.navbar-brand').text().trim()
} catch (err) {
console.error(`Error reading index.html in ${recordFolderPath}:`, err.message)
}
}

results[name || 'Unkown'] = `${item.name}/index.html`
}
})
} catch (err) {
console.error(`Error reading directory ${dirPath}:`, err.message)
}

return results
}

function generateRecordsHtml(recordedTests) {
let links = ''

for (const link in recordedTests) {
Expand All @@ -150,7 +193,7 @@ module.exports = function (config) {
output.print(
`${figures.circleFilled} Step-by-step preview: ${colors.white.bold(`file://${reportDir}/records.html`)}`,
)
})
}

async function persistStep(step) {
if (stepNum === -1) return // Ignore steps from BeforeSuite function
Expand Down
21 changes: 10 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"@xmldom/xmldom": "0.9.5",
"acorn": "8.14.0",
"arrify": "2.0.1",
"axios": "1.7.7",
"axios": "1.7.9",
"chai": "5.1.1",
"chai-deep-match": "1.2.1",
"chai-exclude": "2.1.1",
Expand All @@ -85,8 +85,9 @@
"chai-match-pattern": "1.3.0",
"chai-string": "1.5.0",
"chalk": "4.1.2",
"cheerio": "^1.0.0",
"commander": "11.1.0",
"cross-spawn": "7.0.5",
"cross-spawn": "7.0.6",
"css-to-xpath": "0.1.0",
"csstoxpath": "1.6.0",
"envinfo": "7.14.0",
Expand All @@ -96,8 +97,8 @@
"fs-extra": "11.2.0",
"glob": "6.0.1",
"html-minifier-terser": "7.2.0",
"invisi-data": "^1.0.0",
"inquirer": "6.5.2",
"invisi-data": "^1.0.0",
"joi": "17.13.3",
"js-beautify": "1.15.1",
"lodash.clonedeep": "4.5.0",
Expand Down Expand Up @@ -126,26 +127,24 @@
"@pollyjs/core": "5.1.0",
"@types/chai": "4.3.19",
"@types/inquirer": "9.0.3",
"@types/node": "22.10.1",
"@types/node": "22.10.2",
"@wdio/sauce-service": "9.2.13",
"@wdio/selenium-standalone-service": "8.3.2",
"@wdio/utils": "9.2.8",
"@xmldom/xmldom": "0.9.5",
"apollo-server-express": "3.13.0",
"chai-as-promised": "7.1.2",
"chai-subset": "1.6.0",
"cheerio": "^1.0.0",
"contributor-faces": "1.1.0",
"documentation": "14.0.3",
"electron": "33.2.1",
"eslint": "9.16.0",
"eslint": "9.17.0",
"eslint-config-airbnb-base": "15.0.0",
"eslint-plugin-import": "2.31.0",
"eslint-plugin-mocha": "10.5.0",
"expect": "29.7.0",
"express": "4.21.1",
"express": "4.21.2",
"globals": "15.12.0",
"graphql": "16.9.0",
"graphql": "16.10.0",
"husky": "9.1.7",
"inquirer-test": "2.0.1",
"jsdoc": "4.0.4",
Expand All @@ -166,7 +165,7 @@
"tsd": "^0.31.0",
"tsd-jsdoc": "2.5.0",
"typedoc": "0.26.11",
"typedoc-plugin-markdown": "4.2.10",
"typedoc-plugin-markdown": "4.3.2",
"typescript": "5.7.2",
"wdio-docker-service": "1.5.0",
"webdriverio": "9.2.14",
Expand All @@ -184,4 +183,4 @@
"strict": false
}
}
}
}
Loading

0 comments on commit 0909608

Please sign in to comment.