liveBook · Manning

Integration test

As explained in Build Financial Software with Generative AI (From Scratch)

Integration testing evaluates whether multiple software components work together correctly across their dependencies.

Integration testing checks whether multiple software components work together across their dependencies. Compared with unit and component tests, these tests are less isolated, slower, and more fragile, but they expose failures that isolated tests cannot. section 4.3.1

A practical integration test can coordinate several application layers:

  • Prepare a known environment by clearing the database and loading an ACH file. section 9.2.4
  • Upload or process input, navigate to the search page, populate search criteria, and wait for the resulting API response. section 9.2.4
  • Validate the HTTP status and visible result, then capture a screenshot for regression evidence. section 9.2.4

Testing a transaction search

A Playwright test opens the search page, enters “sally saver,” waits for the transactions-search response, checks for status 200, verifies the matching result is visible, and saves a screenshot. Fixtures launch the browser and isolate each page context. section 9.2.4

Listing 9.19 Playwright testing
def test_dashboard(page: Page):
    page.goto("http://localhost:3000/search") #1
    page.expect_navigation(wait_until="load")  #2
    expect(page).to_have_url("http://localhost:3000/search") #2
    search_criteria = page.get_by_role("textbox") #3
    search_criteria.fill("sally saver")  #4
    search_button = page.locator("#searchbtn") #4
    with page.expect_response("**/files/transactions/search*") #5
➥ as response_info:  #6
        search_button.click()  #6

    response = response_info.value #6
    assert response.status == 200 #6
    search_result = page.locator('div[title="Sally Saver"]') #7
    expect(search_result).to_be_visible()  #8
    page.screenshot(path="screenshots/search_results.png") #8

The test listing shows how browser actions, an API response, visible UI assertions, and screenshot capture form one integration workflow. section 9.2.4

Listing 4.4 Testing our first endpoint
from fastapi import FastAPI     #1
from fastapi.testclient import TestClient #1
from app.main import app   #1

client = TestClient(app)  #2

def test_read_files(): #3
    response = client.get("/files") #4
    assert response.status_code == 200 #5
    assert response.json() ==  #5
➥[{"file": "File_1"}, {"file": "File_2"}]  #5

The endpoint test demonstrates the smaller API boundary that can later grow from a hardcoded response into a dependency-connected integration test. section 4.3.1

How Build Financial Software with Generative AI (From Scratch) covers it

How deep it goes
Explains the testing-pyramid position and implements setup, browser actions, API waits, assertions, fixtures, and screenshots.
Examples
Demonstrates FastAPI endpoint checks, BDD scenarios, ACH-file setup, transaction search, browser assertions, and screenshots.
What it assumes
Assumes basic application and testing concepts, then supplies concrete FastAPI, Pytest, database, file-processing, and browser-test setup.
What you can do after
Apply it via Pytest and Playwright to validate API responses, dependency-backed data, browser behavior, and regression evidence.
How it connects
Connects integration testing with unit testing, component testing, UI testing, API testing, regression testing, and manual testing.

Also explained in

Compare how 31 books explain integration test →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build Financial Software with Generative AI (From Scratch). The section links point to the parts of the book it draws on.