Skip to content

Commit

Permalink
Merge branch 'main' of github.com:ceajs/slide-captcha
Browse files Browse the repository at this point in the history
  • Loading branch information
beetcb committed Dec 3, 2021
2 parents d9e90b5 + 2284c6a commit e2a5574
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 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]
No need for the original image, `@ceajs/slider-captcha` will get the slider target position by processing the slider background image [status: WIP]

# Demo

Expand Down
7 changes: 4 additions & 3 deletions src/index.test.js → index.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { test, expect } from '@playwright/test'
import { findMovePercent } from './index.js'
let peakTestInterval = 1000
import sliderCaptchaRecognizer from './src/index.js'

const peakTestInterval = 1000

test.describe.parallel('Verify Captcha', () => {
for (let i = 0; i < peakTestInterval; i++) {
Expand Down Expand Up @@ -29,7 +30,7 @@ test.describe.parallel('Verify Captcha', () => {
'**/sliderCaptcha.do**'
)
const data = await response.json()
const movePercent = await findMovePercent(
const movePercent = await sliderCaptchaRecognizer(
data.bigImage,
data.smallImage,
i.toString()
Expand Down
2 changes: 1 addition & 1 deletion src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @param n alias for test purpose
* @return Percentage of moving slider
*/
export function findMovePercent(
export default function sliderCaptchaRecognizer(
bigImage: string,
smallImage: string,
n?: string
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const __dirname = path.dirname(
fileURLToPath(import.meta.url)
)

export async function findMovePercent(
export default async function sliderCaptchaRecognizer(
bigImage,
smallImage,
n
Expand Down
Binary file modified template.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e2a5574

Please sign in to comment.