Selenium Integration

Integrate Standard Checks into your Selenium test automation with our SDK and REST API.

Authentication

First, get your access token:

Get Access Token
curl -X POST https://us-central1-taiser-476406.cloudfunctions.net/main/api/auth/get-token \
  -H "Content-Type: application/json" \
  -d '{"email":"your@email.com"}'

Quick Start

Installation
pip install requests selenium
Basic Integration
import requests
import base64
from selenium import webdriver

class StandardChecksTester:
    def __init__(self, api_url, token=None):
        self.api_url = api_url
        self.token = token  # Access token from /api/auth/get-token
    
    def run_standard_checks_screenshot(self, driver, testers='auto', output_format='default'):
        # Take screenshot
        screenshot = driver.get_screenshot_as_png()
        
        # Run standard checks with AI
        response = requests.post(f"{self.api_url}/api/test", 
            files={'artifact': ('screenshot.png', screenshot, 'image/png')},
            data={
                'artifactType': 'screenshot',
                'testers': testers,
                'outputFormat': output_format,
                'aiProvider': 'gemini',
                'apiKey': self.api_key
            }
        )
        return response.json()
    

# Usage in your Selenium tests
def test_login_page():
    driver = webdriver.Chrome()
    standard_checks = StandardChecksTester("https://us-central1-taiser-476406.cloudfunctions.net/main", "your-access-token")
    
    try:
        driver.get("https://example.com/login")
        
        # Run standard checks for visual issues
        screenshot_results = standard_checks.run_standard_checks_screenshot(driver)
        assert len(screenshot_results.get('bugs', [])) == 0, "Standard checks found visual issues"
        
        
    finally:
        driver.quit()

API Endpoints

POST /api/test

Run standard checks on an artifact with AI testers

artifactType string Type of artifact: screenshot
artifact file/string The artifact file or text content to analyze
testers string/array 'auto' for AI selection, or array of tester IDs for manual selection
token string Your access token (required)

Authentication Endpoints

All API requests require an access token. Use these endpoints to get and manage your token.

POST /api/auth/get-token

Get or create an access token for API usage

email string Your email address
GET /api/auth/info

Get information about your access token and rate limits

token string (query) Your access token
POST /api/auth/register

Register a new user and get an access token

email string Your email address

Best Practices

Strategic Testing
Run standard checks at key user journey points: login, checkout, form submissions, and critical user flows.
Performance Optimization
Use async calls and run standard checks in parallel with your existing tests to minimize execution time.
Integration Patterns
Integrate standard checks into your CI/CD pipeline and run them on staging environments before production deployments.

Playwright Integration

Integrate Standard Checks into your Playwright test automation with our SDK and REST API.

Quick Start

Installation
npm install @playwright/test axios
Basic Integration
const { test, expect } = require('@playwright/test');
const axios = require('axios');

class StandardChecksTester {
    constructor(apiUrl, token = null) {
        this.apiUrl = apiUrl;
        this.token = token;  // Access token from /api/auth/get-token
    }

    async runStandardChecksScreenshot(page, testers = 'auto', outputFormat = 'default') {
        // Take screenshot
        const screenshot = await page.screenshot({ fullPage: true });
        
        // Run standard checks with AI
        const formData = new FormData();
        formData.append('artifact', new Blob([screenshot], { type: 'image/png' }), 'screenshot.png');
        formData.append('artifactType', 'screenshot');
        formData.append('testers', testers);
        formData.append('outputFormat', outputFormat);
        formData.append('aiProvider', 'gemini');
        formData.append('token', this.token);

        formData.append('token', this.token);
        const response = await axios.post(`${this.apiUrl}/api/test`, formData, {
            headers: { 
                'Content-Type': 'multipart/form-data',
                'X-Access-Token': this.token
            }
        });
        return response.data;
    }

}

// Usage in your Playwright tests
test('Standard checks for login page', async ({ page }) => {
    const standardChecks = new StandardChecksTester('https://us-central1-taiser-476406.cloudfunctions.net/main', 'your-access-token');
    
    await page.goto('https://example.com/login');
    
    // Run standard checks for visual issues
    const screenshotResults = await standardChecks.runStandardChecksScreenshot(page);
    expect(screenshotResults.bugs).toHaveLength(0);
    
});

API Endpoints

POST /api/test

Run standard checks on an artifact with AI testers

artifactType string Type of artifact: screenshot
artifact file/string The artifact file or text content to analyze
testers string/array 'auto' for AI selection, or array of tester IDs for manual selection

Best Practices

Strategic Testing
Run standard checks at key user journey points: login, checkout, form submissions, and critical user flows.
Performance Optimization
Use async calls and run standard checks in parallel with your existing tests to minimize execution time.
Integration Patterns
Integrate standard checks into your CI/CD pipeline and run them on staging environments before production deployments.

Cypress Integration

Integrate Standard Checks into your Cypress test automation with our SDK and REST API.

Quick Start

Installation
npm install cypress
Basic Integration
// cypress/support/standard-checks.js
class StandardChecksTester {
    constructor(apiUrl, token = null) {
        this.apiUrl = apiUrl;
        this.token = token;  // Access token from /api/auth/get-token
    }

    async runStandardChecksScreenshot(testers = 'auto', outputFormat = 'default') {
        // Take screenshot
        const screenshot = await cy.screenshot('standard-checks', { capture: 'fullPage' });
        
        // Run standard checks with AI
        return cy.request({
            method: 'POST',
            url: `${this.apiUrl}/api/test`,
            form: true,
            body: {
                artifactType: 'screenshot',
                artifact: screenshot,
                testers: testers,
                outputFormat: outputFormat,
                aiProvider: 'gemini',
                token: this.token
            }
        }).then(response => response.body);
    }

}

// Make available globally
Cypress.StandardChecksTester = StandardChecksTester;

// Usage in your Cypress tests
describe('Standard Checks Tests', () => {
    let standardChecks;

    beforeEach(() => {
        standardChecks = new Cypress.StandardChecksTester('https://us-central1-taiser-476406.cloudfunctions.net/main', 'your-access-token');
    });

    it('should pass standard checks for visual issues', () => {
        cy.visit('https://example.com');
        
        standardChecks.runStandardChecksScreenshot().then(results => {
            expect(results.bugs).to.have.length(0);
        });
    });

});

API Endpoints

POST /api/test

Run standard checks on an artifact with AI testers

artifactType string Type of artifact: screenshot
artifact file/string The artifact file or text content to analyze
testers string/array 'auto' for AI selection, or array of tester IDs for manual selection

Best Practices

Strategic Testing
Run standard checks at key user journey points: login, checkout, form submissions, and critical user flows.
Performance Optimization
Use async calls and run standard checks in parallel with your existing tests to minimize execution time.
Integration Patterns
Integrate standard checks into your CI/CD pipeline and run them on staging environments before production deployments.

Eggplant Sensetalk Integration

Integrate Standard Checks into your Eggplant Sensetalk test automation with our REST API.

Quick Start

Setup
// No additional setup required - use built-in HTTP capabilities
Basic Integration
// Standard Checks integration for Eggplant Sensetalk
to runStandardChecksScreenshot
    // Take screenshot
    set screenshot to captureScreen()
    
    // Convert to base64 for API
    set screenshotBase64 to base64Encode(screenshot)
    
    // Prepare API request
    set apiUrl to "https://your-domain.com/api/test"
    set requestBody to "artifactType=screenshot&artifact=" & screenshotBase64 & "&testers=auto&aiProvider=gemini"
    
    // Make API call
    set response to post(apiUrl, requestBody, "application/x-www-form-urlencoded")
    
    // Parse response
    set result to parseJSON(response)
    
    // Check for bugs
    if result.bugs.length > 0 then
        log "Standard checks found " & result.bugs.length & " issues"
        repeat with bug in result.bugs
            log "Bug: " & bug.bug_title & " (Priority: " & bug.bug_priority & ")"
        end repeat
    else
        log "No issues found by standard checks"
    end if
    
    return result
end runStandardChecksScreenshot

// Usage in your Eggplant tests
to testLoginPage
    // Navigate to login page
    click "LoginButton"
    
    // Run standard checks
    set results to runStandardChecksScreenshot()
    
    // Assert no critical issues
    set criticalBugs to filter(result.bugs, bug.bug_priority >= 7)
    if criticalBugs.length > 0 then
        fail "Critical issues found: " & criticalBugs.length
    end if
end testLoginPage

API Endpoints

POST /api/test
Submit artifacts for AI-powered standard checks analysis
artifactType string Type of artifact: 'screenshot'
artifact string The artifact file or text content to analyze
testers string/array 'auto' for AI selection, or array of tester IDs for manual selection

Best Practices

Strategic Testing
Run standard checks at key user journey points: login, checkout, form submissions, and critical user flows.
Performance Optimization
Use async calls and run standard checks in parallel with your existing tests to minimize execution time.
Integration Patterns
Integrate standard checks into your CI/CD pipeline and run them on staging environments before production deployments.

cURL Integration

Use cURL to integrate Standard Checks into any environment or scripting language. Perfect for shell scripts, CI/CD pipelines, and quick testing.

Installation

cURL Installation
# cURL is pre-installed on most systems
# Check version: curl --version

API Examples

Simplest Example (Required Parameters Only)
curl -X POST https://us-central1-taiser-476406.cloudfunctions.net/main/api/test \
  -H "X-Access-Token: YOUR_TOKEN" \
  -F "artifact=@screenshot.png" \
  -F "token=YOUR_TOKEN" \
  -F "artifactType=screenshot"
With AI Provider
curl -X POST https://us-central1-taiser-476406.cloudfunctions.net/main/api/test \
  -H "X-Access-Token: YOUR_TOKEN" \
  -F "artifact=@screenshot.png" \
  -F "token=YOUR_TOKEN" \
  -F "artifactType=screenshot" \
  -F "aiProvider=gemini"
With Specific Testers
curl -X POST https://us-central1-taiser-476406.cloudfunctions.net/main/api/test \
  -H "X-Access-Token: YOUR_TOKEN" \
  -F "artifact=@screenshot.png" \
  -F "token=YOUR_TOKEN" \
  -F "artifactType=screenshot" \
  -F "testers=sharon,alejandro,pete" \
  -F "aiProvider=openai" \
  -F "apiKey=your-openai-api-key" \
  -F "customInstructions=Focus on security and accessibility issues"
With Custom Output Format
curl -X POST https://us-central1-taiser-476406.cloudfunctions.net/main/api/test \
  -H "X-Access-Token: YOUR_TOKEN" \
  -F "artifact=@screenshot.png" \
  -F "token=YOUR_TOKEN" \
  -F "artifactType=screenshot" \
  -F "testers=auto" \
  -F "aiProvider=gemini" \
  -F "apiKey=your-gemini-api-key" \
  -F "outputFormat=jira"
Save Response to File
curl -X POST https://us-central1-taiser-476406.cloudfunctions.net/main/api/test \
  -H "X-Access-Token: YOUR_TOKEN" \
  -F "artifact=@screenshot.png" \
  -F "token=YOUR_TOKEN" \
  -F "artifactType=screenshot" \
  -F "testers=auto" \
  -F "aiProvider=gemini" \
  -F "apiKey=your-gemini-api-key" \
  -o results.json
With Verbose Output for Debugging
curl -v -X POST https://us-central1-taiser-476406.cloudfunctions.net/main/api/test \
  -H "X-Access-Token: YOUR_TOKEN" \
  -F "artifact=@screenshot.png" \
  -F "token=YOUR_TOKEN" \
  -F "artifactType=screenshot" \
  -F "testers=auto" \
  -F "aiProvider=gemini" \
  -F "apiKey=your-gemini-api-key"

JavaScript Examples

Simplest Example (Required Parameters Only)
const formData = new FormData();
formData.append('artifact', screenshotFile);
formData.append('token', 'YOUR_TOKEN');
formData.append('artifactType', 'screenshot');

const response = await fetch('https://us-central1-taiser-476406.cloudfunctions.net/main/api/test', {
  method: 'POST',
  headers: {
    'X-Access-Token': 'YOUR_TOKEN'
  },
  body: formData
});

const result = await response.json();
console.log(result.bugs); // Array of detected issues
With AI Provider
const formData = new FormData();
formData.append('artifact', screenshotFile);
formData.append('token', 'YOUR_TOKEN');
formData.append('artifactType', 'screenshot');
formData.append('aiProvider', 'gemini');

const response = await fetch('https://us-central1-taiser-476406.cloudfunctions.net/main/api/test', {
  method: 'POST',
  headers: {
    'X-Access-Token': 'YOUR_TOKEN'
  },
  body: formData
});

const result = await response.json();
console.log(result.bugs);
With Custom Instructions
const formData = new FormData();
formData.append('artifact', screenshotFile);
formData.append('token', 'YOUR_TOKEN');
formData.append('artifactType', 'screenshot');
formData.append('testers', 'sharon,alejandro');
formData.append('aiProvider', 'openai');
formData.append('apiKey', 'your-openai-api-key');
formData.append('customInstructions', 'Focus on accessibility issues');

const response = await fetch('https://us-central1-taiser-476406.cloudfunctions.net/main/api/test', {
  method: 'POST',
  headers: {
    'X-Access-Token': 'YOUR_TOKEN'
  },
  body: formData
});

const result = await response.json();
console.log(result.bugs);

Python Examples

Simplest Example (Required Parameters Only)
import requests

with open('screenshot.png', 'rb') as f:
    files = {'artifact': f}
    data = {
        'token': 'YOUR_TOKEN',
        'artifactType': 'screenshot'
    }
    
    response = requests.post(
        'https://us-central1-taiser-476406.cloudfunctions.net/main/api/test',
        files=files,
        data=data,
        headers={'X-Access-Token': 'YOUR_TOKEN'}
    )
    
    result = response.json()
    print(result['bugs'])  # Array of detected issues
With AI Provider
import requests

with open('screenshot.png', 'rb') as f:
    files = {'artifact': f}
    data = {
        'token': 'YOUR_TOKEN',
        'artifactType': 'screenshot',
        'aiProvider': 'gemini'
    }
    
    response = requests.post(
        'https://us-central1-taiser-476406.cloudfunctions.net/main/api/test',
        files=files,
        data=data,
        headers={'X-Access-Token': 'YOUR_TOKEN'}
    )
    
    result = response.json()
    print(result['bugs'])
With Custom Instructions
import requests

with open('screenshot.png', 'rb') as f:
    files = {'artifact': f}
    data = {
        'token': 'YOUR_TOKEN',
        'artifactType': 'screenshot',
        'testers': 'sharon,alejandro',
        'aiProvider': 'openai',
        'apiKey': 'your-openai-api-key',
        'customInstructions': 'Focus on security vulnerabilities'
    }
    
    response = requests.post(
        'https://us-central1-taiser-476406.cloudfunctions.net/main/api/test',
        files=files,
        data=data,
        headers={'X-Access-Token': 'YOUR_TOKEN'}
    )
    
    result = response.json()
    print(result['bugs'])
Generate Test Cases
curl -X POST https://us-central1-taiser-476406.cloudfunctions.net/main/api/generate-test-cases \
  -H "X-Access-Token: YOUR_TOKEN" \
  -F "artifact=@screenshot.png" \
  -F "token=YOUR_TOKEN" \
  -F "testCaseCount=5" \
  -F "outputFormat=ai-test-case" \
  -F "aiProvider=gemini" \
  -F "pageName=Homepage" \
  -F "pageUrl=https://example.com"
Generate Playwright Test Cases
curl -X POST https://us-central1-taiser-476406.cloudfunctions.net/main/api/generate-test-cases \
  -H "X-Access-Token: YOUR_TOKEN" \
  -F "artifact=@screenshot.png" \
  -F "token=YOUR_TOKEN" \
  -F "testCaseCount=5" \
  -F "outputFormat=playwright" \
  -F "aiProvider=gemini" \
  -F "pageName=Login Page" \
  -F "pageUrl=https://example.com/login"

Response Format

JSON Response Example
{
  "bugs": [
    {
      "bug_title": "Low contrast text",
      "bug_type": ["WCAG", "Text Contrast"],
      "bug_confidence": 8,
      "bug_priority": 5,
      "bug_reasoning_why_a_bug": "The text contrast ratio is below WCAG AA standards...",
      "bug_reasoning_why_not_a_bug": "The contrast might be sufficient for users with normal vision...",
      "suggested_fix": "Increase the contrast ratio to at least 4.5:1...",
      "bug_why_fix": "Low contrast affects accessibility for users with visual impairments...",
      "what_type_of_engineer_to_route_issue_to": "Frontend Engineer",
      "possibly_relevant_page_text": "Navigation menu text",
      "possibly_relevant_page_elements": "{'tag_name': 'nav', 'text_content': 'Home About Contact'}",
      "tester": "Sharon",
      "byline": "Accessibility Tester",
      "image_url": "https://testers.ai/img/profiles/sharon.png"
    }
  ],
  "summary": {
    "total_bugs": 1,
    "by_priority": {"High": 1},
    "by_type": {"WCAG": 1, "Text Contrast": 1},
    "by_tester": {"Sharon": 1}
  }
}

Best Practices

File Upload

  • Use -F "artifact=@filename.png" for file uploads
  • Ensure the file path is correct and accessible
  • Supported formats: PNG, JPG, JPEG

Error Handling

  • Use -v flag for verbose output when debugging
  • Check HTTP status codes in responses
  • Save responses to files with -o filename.json

CI/CD Integration

  • Use environment variables for API keys
  • Save results to files for further processing
  • Include error handling in shell scripts