Giter Club home page Giter Club logo

test_rail_dart's Introduction

Dutchie Logo

Test Rail Dart

This package is a thin wrapper around the TestRail API that will allow for automated test reporting in Dart. It enables a user to start, report case pass/fail, and close your test runs from a Dart interface.

Getting Started

Initialize the TestRail instance using the config method:

TestRail.config(
  username: 'USERNAME',
  password: 'PASSWORD',
  /// The url that points to the test rail server => https://example.testrail.com
  serverDomain: 'https://YOUR_SERVER.testrail.com',
)

Usage

Create Test case

/// Create new test case in section
final createdTestCase = await TestCase.create(
  // Replace with your own sectionId
  1,
  title: 'Test case from API',
  customValues: <String, dynamic>{
    // Custom fields start with "custom_" prefix
    'custom_feedback': 'This case should be tested last',
  },
);

Delete Test case

/// Get TestCase by ID
final testCase = await TestCase.get(1);

await testCase.delete();

Create or Update Runs

/// Start by creating a new run
final newRun = await TestRun.create(
  name: 'Test execution',
  projectId: 1,
);

/// Add cases to the run
await newRun.updateRun(
  caseIds: [1, 2, 3, 5],
);

Once the run is created, results can be reported by case:

final result = await newRun.addResultForCase(
  caseId: 1,
  statusId: 1,
);

// Optionally add a screenshot or other image to the result
await result.addAttachment(
  '/workspace/attachments/failure.png',
);

Get

Historical runs, cases, and sections can be retrieved:

final testCase = await TestCase.get(1);

final testCases = await TestCase.getAll(1);

final testRun = await TestRun.get(1);

final testSection = await TestSection.get(1);

final testCaseHistory = await TestCaseHistory.get(1);

Completed or ongoing test run results can be retrieved:

final caseResults = await TestResult.getCaseResults(
  // Case ID is from TestCases, not TestRun
  184234,
  runId: 1833,
);

final runResults = await TestResult.getRunResults(
  1818,
  statusId: [5, 1],
);

final testResults = await TestResult.getTestResults(
  // Test ID from particular TestRun
  1868150,
);

About Dutchie

We’re not just building the future of shopping for cannabis, we’re building a culture of innovation, customer care, and challenge to the status quo.

Inspired? Join our team of Dart and Flutter developers today

test_rail_dart's People

Contributors

nasrallahelfarra avatar ervuks avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.