Skip to content

Commit

Permalink
testing
Browse files Browse the repository at this point in the history
  • Loading branch information
shivamguys committed Apr 9, 2024
1 parent 7b7be01 commit 9c50441
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ function performLogin(LOGGED_IN) {
// get captcha value base64 starts---------
cy.get('.captcha-img').invoke('attr', 'src').then((value) => {
// api call to retrieve captcha value
cy.task("log", `python3 irctc-captcha-solver/app.py --image-base-64 "${value}"`)
cy.exec(`python3 irctc-captcha-solver/app.py --image-base-64 "${value}"`).then((result) => {
cy.exec(`python3 irctc-captcha-solver/app.py "${value}"`).then((result) => {
cy.get('#captcha').type(result.stdout).type('{enter}');
// cy.contains('SIGN IN').click()
cy.get('body').then((el) => {
Expand Down Expand Up @@ -143,7 +142,7 @@ function solveCaptcha() {
// get captcha value base64 starts---------
cy.get('.captcha-img').invoke('attr', 'src').then((value) => {
// api call to retrieve captcha value
cy.exec(`python3 irctc-captcha-solver/app.py --image-base-64 "${value}"`).then((result) => {
cy.exec(`python3 irctc-captcha-solver/app.py "${value}"`).then((result) => {

cy.get('#captcha').type(result.stdout).type('{enter}')
cy.get('body').then((el) => {
Expand Down
5 changes: 2 additions & 3 deletions irctc-captcha-solver/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ def extract_text_from_image(base64_image):
description="Extract text from a base64 encoded image."
)
parser.add_argument(
"--image-base-64",
dest="image",
"image",
type=str,
nargs="?",
default="",
Expand All @@ -44,7 +43,7 @@ def extract_text_from_image(base64_image):
args = parser.parse_args()

if args.image == "":
print("No --image-base-64 provided")
print("No base-64 String provided")
else:
extracted_text = extract_text_from_image(args.image)
print(extracted_text)

0 comments on commit 9c50441

Please sign in to comment.