Skip to content

Commit

Permalink
feat: update playwright test data
Browse files Browse the repository at this point in the history
  • Loading branch information
beetcb committed Dec 2, 2021
1 parent 7682f82 commit c2aa613
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
# Silder Captcha Recognition Helper for [Cea][cea]

No need for the original image, `@ceajs/slider-captch` will get the slider target position by processing the slider background image [status: WIP]

# Demo

![demo gif](./demo.gif)

# Recognition Trustworthiness

Playwright test result:
Playwright test result(Tested by simulating the unified login of [hqu University][hqu]):

```bash
> npx playwright test

Running 1000 tests using 4 workers
...
728 passed (49m)
837 passed (26m)
```

[cea]: https://github.com/ceajs/cea/issues/25
[hqu]: https://hqu.campusphere.net/portal/login
22 changes: 11 additions & 11 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,23 +69,23 @@ export async function findMovePercent(
const matchOriginPoint = contours.get(0).data32S
movePercent =
matchOriginPoint[0] / captchaImg.getWidth()
printRec(test, dstTempl, matchOriginPoint)
// printRec(test, dstTempl, matchOriginPoint)
} else {
console.error(
`Error: Recognizing slider ${n ?? 'test'}`
)
}

new Jimp({
width: test.cols,
height: test.rows,
data: Buffer.from(test.data),
}).write(
path.join(
__dirname,
`../processed-img/${n ?? 'test'}.png`
)
)
// new Jimp({
// width: test.cols,
// height: test.rows,
// data: Buffer.from(test.data),
// }).write(
// path.join(
// __dirname,
// `../processed-img/${n ?? 'test'}.png`
// )
// )

return movePercent
}
Expand Down

0 comments on commit c2aa613

Please sign in to comment.