Stirling-Tools / Stirling-PDF

#1 Locally hosted web application that allows you to perform various operations on PDF files
https://stirlingpdf.com
MIT License
43.13k stars 3.48k forks source link

Add tests via TestDriverAI #1957

Open chottuthejimmy opened 1 week ago

chottuthejimmy commented 1 week ago

Description

This PR contains the test cases to test the basic functionality of the stirling.io webpage. The tests are written using testdriverai a next gen automation AI agent for end-to-end testing of web and desktop application.

Overview

This PR adds TestDriver tests that I generated using the testdriverai npm package. Instead of using selectors, TestDriver uses prompts and AI vision to complete tasks. This means the tests will still work even when code and design changes.

Another huge benefit is we can test PDF input and output because tests operate at the OS level. You can see the schema of supported commands here.

Test Cases

Setup

In order to complete this PR you’ll need to add a API key as a GitHub action secret. Follow the directions here for more info. Once you sign up, let us know your email and we’ll enroll you in the open source program for free Pro account.

Here's how to add more tests :

What’s next

We can set this up to build feature branches using our prerun scripts.

Checklist

ianjennings commented 1 week ago

@Frooodle We need your approval to run the workflow.

CleanShot 2024-09-24 at 12 28 52

Frooodle commented 1 week ago

I believe I need the key: ${{secrets.TESTDRIVER_API_KEY}}

As well? Additionally we should set it up to run on PR code not on web instance :p

ianjennings commented 1 week ago

Here is a preview of the test execution:

testdriverai/Stirling-PDF/refs/heads/main

Watch testdriverai/Stirling-PDF/refs/heads/main on Dashcam

chottuthejimmy commented 6 days ago

Hey @Frooodle could you have another look at this.

It's a go from our side!

Cheers!

Frooodle commented 6 days ago

Sorry been very busy should be able to properly check it end of week

Frooodle commented 3 days ago

Added key but job still failed, does account need upgraded?

ianjennings commented 1 day ago

Added key but job still failed, does account need upgraded?

The API is reporting the key a null. Are you sure PRs have perms to access secrets? Or the variable name is correct?

chottuthejimmy commented 6 hours ago

Hey @Frooodle could please make sure you have got the API set up properly. I would be happy to hop on a call and help you out, so let me know.

Frooodle commented 1 hour ago

Secret is there along side other secrets used within this repo, image