1.12.2 • Published 4 years ago

einstein-sdk v1.12.2

Weekly downloads
989
License
ISC
Repository
-
Last release
4 years ago

Einstein SDK

API SDK for Einstein according to Einstein SDK HTTP API

Installation

npm install einstein-sdk

APIs

Login

import EinsteinSDK from 'einstein-sdk';
// or use: const EinsteinSDK = require('einstein-sdk').default;

const EINSTEIN_ENDPOINT = 'https://einstein.ringcentral.com';
const einsteinSdk = new EinsteinSDK(EINSTEIN_ENDPOINT);
await einsteinSdk.login('username', 'password');

Logout

einsteinSdk.logout();

Get Projects

const projects = await einsteinSdk.getProjects();

Get Project

const project = await einsteinSdk.getProject(projectId);

Get Suites

const suites = await einsteinSdk.getSuites(projectId);

Get Test Cases

const testCase = await einsteinSdk.getTestCase(testCaseId);

Update Test Case

const testCase = await einsteinSDK.getTestCase(TEST_CASE_ID);
const parameter = {
  id: testCase.id,
  versionId: testCase.version.id,
  name: `${testCase.name} new`,
  summary: `${testCase.summary} new`,
  preconditions: `${testCase.preconditions} new`,
  priority: PRIORITY_ENUM.P3,
  executionType: EXECUTION_TYPE_ENUM.Automated,
  steps: [
    ...testCase.children,
    {
      name: 'step1',
      expectedResult: 'no result',
      execution: EXECUTION_TYPE_ENUM.Automated,
    },
    {
      name: 'step2',
      expectedResult: 'no result2',
      execution: EXECUTION_TYPE_ENUM.Automated,
    }
  ]
};
const response = await einsteinSDK.updateTestCase(parameter);

Create Test Case

const data = {
  projectId: ${projectId},
  parentId: ${parentId},
  name: 'Einstein SDK Test',
  priority: PRIORITY_ENUM.P3,
  executionType: EXECUTION_TYPE_ENUM.Automated,
  summary: 'This is summary.',
  preconditions: 'This is preconditions.',
  steps: [
    {
      name: 'Step 1',
      expectedResult: 'Expected result 1',
      execution: EXECUTION_TYPE_ENUM.Automated,
    },
    {
      name: 'Step 2',
      expectedResult: 'Expected result 2',
      execution: EXECUTION_TYPE_ENUM.Automated,
    },
    {
      name: 'Step 3',
      expectedResult: 'Expected result 3',
      execution: EXECUTION_TYPE_ENUM.Automated,
    },
  ]
};
const response = await einsteinSDK.createTestCase(data);

Get Test Cases By Keyword Ids

const testCases = await einsteinSdk.getTestCasesByKeywordIds(projectId, keywordsIds);

Get Test Plans

const testPlans = await einsteinSdk.getTestPlans(projectId);

Create Test Plan

await einsteinSdk.createTestPlan(projectId, testPlanName, notes);

Add Test Case To Test Plans

await einsteinSdk.addTestCaseToTestPlans(testCaseId, testPlanIds);

Add Test Cases To Test Plan

await einsteinSDK.addTestCasesToTestPlan(projectIds, testCaseIds, testPlanId);

Get Builds

const builds = await einsteinSdk.getBuilds(testPlanId);

Create Build

await einsteinSdk.createBuild(testPlanId, buildName, notes);

Add Value To Custom Field

await einsteinSdk.addValueToCustomField(projectId, customFieldName, name, description, visibility);

Get Test Executions

const executions = await einsteinSdk.getTestExecutions(testCaseId);

Get Project Keywords

const keywords = await einsteinSdk.getKeywords(projectId);

Get Meta Data By Project Name

const metaData = await einsteinSdk.getMetaDataByProjectName(projectName);

Search Test Case In Test Suite Scope

const testCases = await einsteinSdk.searchTestCasesByExpression(projectName, expression);

Search Test Case In Test Executions Scope

const testCases = await einsteinSdk.searchTestCasesInTestExecutionsByExpression(projectName, testPlanName, expression);

Update test case properties

await einsteinSDK.bulkUpdateTestCaseProperties(data);

Get suggest test cases

const pattern = 'xxx';
await einsteinSDK.getSuggestTestCases(pattern);

Fields For Searching Test Cases

FieldKeyword In ExpressionAvailable OperatorsPredefined ValuesAvailable?
Projectproject=n/a
Test plantest_plan=, inn/a
Case Idcase_id=, inn/a
Case Namecase_nameliken/a
Suitesuite=, inn/a
Suite Namesuite_nameliken/a
Summarysummaryliken/a
Preconditionspreconditionsliken/a
Test Steptest_stepliken/a
Expected Resultexpected_resultliken/a
Texttextliken/a
Prioritypriority=, in"P0", "P1", "P2", "P3"
Execution Typeexecution_type=, in"Manual", "Automated", "Automatable", "NotAutomatable", "ReadyForAutomation", "AutomationExpired", "AutomationSuspended"
Last Execution Statuslast_execution_status=, in"Passed", "Failed", "Blocked", "Skipped", "NotApplicable", "NotRun"
Execution Statusexecution_status=, in"Passed", "Failed", "Blocked", "Skipped", "NotApplicable", "NotRun"
Tested Bytested_by=, inn/a
Versionversion=, in"Active", "Last"
Version Numberversion_number=, inn/a
Created Bycreated_by=, inn/a
Date Createddate_created<,<=,>,>=n/a
Last Updatedlast_updated<,<=,>,>=n/a
Date Updatedate_updated<,<=,>,>=n/a
Updated Byupdated_by=, inn/a
Req. Doc. Id (coverage)document_idliken/a
Runruninn/a
Custom Fields@custom field name@inn/a

Searching Expression Samples

Search Test Cases By Project Name Only

project = "RC Cloud Integration"

Search Test Cases By Project Name And Test Plan Name

project in "RC Cloud Integration" and test_plan = "Salesforce V3.41"
project in "RC Cloud Integration" and test_plan in "Salesforce V3.41, Google&Office365 - V2.6.0"

Search Test Cases By Project Name And Test Case Id

project = "RC Cloud Integration" and case_id = "1286"
project = "RC Cloud Integration" and case_id in "1286, 42"

Search Test Cases By Project Name And Test Case Name

project = "RC Cloud Integration" and case_name like "Log into RC CTI app with phone number/email"

Search Test Cases By Project Name And Suite Name (suite name can be a nested structure split by '.')

project = "RC Cloud Integration" and suite = "Firefox"
project = "RC Cloud Integration" and suite in "Firefox, Skype for Business"
project = "Ringcentral meetings" and suite = "SW - Settings/Reports/Dashboard.Meetings Report.Admin Portal.Webinar" and version = "Active"
project = "RC Cloud Integration" and suite_name like "Firefox"

Search Test Cases By Project Name And Summary

project = "RC Cloud Integration" and summary like "To verify whether user is able to log into RC CTI"

Search Test Cases By Project Name And Preconditions

project = "RC Cloud Integration" and preconditions like "User must have RC CTI account"

Search Test Cases By Project Name And Test Step

project = "RC Cloud Integration" and test_step like "enter extension(optional) and password"

Search Test Cases By Project Name And Expected Result

project = "RC Cloud Integration" and expected_result like "Password entered, value is hidden"

Search Test Cases By Project Name And Text

project = "RC Cloud Integration" and text like "password"

Search Test Cases By Project Name And Priority

Optional values for priority: "P0", "P1", "P2", "P3"

project = "RC Cloud Integration" and priority = "P0"
project = "RC Cloud Integration" and priority in "P0, P1, P2"

Search Test Cases By Project Name And Execution Type

Optional values for execution type: "Manual", "Automated", "Automatable", "NotAutomatable", "ReadyForAutomation"

project = "RC Cloud Integration" and execution_type = "Automated"
project = "RC Cloud Integration" and execution_type in "Automated, Automatable"

Search Test Cases By Project Name And Last Execution Status

Optional values for last execution status: "Passed", "Failed", "Blocked", "Skipped", "NotApplicable", "NotRun"

project = "RC Cloud Integration" and last_execution_status = "Passed"
project = "RC Cloud Integration" and last_execution_status in "Passed, Failed, Skipped"

Search Test Cases By Project Name And Execution Status

Optional values for execution status: "Passed", "Failed", "Blocked", "Skipped", "NotApplicable", "NotRun"

project = "RC Cloud Integration" and execution_status = "Passed"
project = "RC Cloud Integration" and execution_status in "Passed, Failed, Skipped"

Search Test Cases By Tested By

project = "RC Cloud Integration" and tested_by = "yuki.chen"
project = "RC Cloud Integration" and tested_by in "yuki.chen, klay.chen"

Search Test Cases By Project Name And Version

Optional values for version: "Active", "Last"

project = "RC Cloud Integration" and version = "Active"
project = "RC Cloud Integration" and version in "Active, Last"

Search Test Cases By Project Name And Version Number

project = "RC Cloud Integration" and version_number = "21"
project = "RC Cloud Integration" and version_number in "20, 21"

Search Test Cases By Created By

project = "RC Cloud Integration" and created_by = "yuki.chen"
project = "RC Cloud Integration" and created_by in "yuki.chen, klay.chen"

Search Test Cases By Date Created

project = "RC Cloud Integration" and date_created >= "2019-04-01"
project = "RC Cloud Integration" and date_created < "2019-04-01"

Search Test Cases By Updated By

project = "RC Cloud Integration" and updated_by = "yuki.chen"
project = "RC Cloud Integration" and updated_by in "yuki.chen, klay.chen"

Search Test Cases By Last Updated

project = "RC Cloud Integration" and last_updated >= "2019-04-01"
project = "RC Cloud Integration" and last_updated < "2019-04-01"

Search Test Cases By Document Id

project = "RC Cloud Integration" and document_id like "abc"

Search Test Cases By Project Name And Custom Fields

Wrapper custom field with "@" and "@".

project = "RC Cloud Integration" and @Keywords@ in "Salesforce, Outlook"
project = "RC Cloud Integration" and @Automation@ in "Automatable, Automated"
project = "RC Cloud Integration" and @Release Name@ in "Release_10.0, Release_10.1"

Search Test Cases By Run

project = "Ringcentral meetings" and run in "9.4 Meeings Dashboard Regression testing: 5.4 Mac Rooms" and version = "Active"

Search Test Cases Using "in", "or", "()" and "!'

(project = "RC Cloud Integration" and @Keywords@ in "Salesforce, Outlook") or ((project = "RC Cloud Integration" and execution_type = "Automated"))
project = "RC Cloud Integration" and @Keywords@ in "Google" and priority="P0" and !(@Keywords@ in "Automation_Expired, Manual, Automated_Google")

Important Notice

It's necessary to add version = "Active" in every query expression.

More Information

See Test Cases for Einstein SDK to get more details.

1.12.2

4 years ago

1.12.0

4 years ago

1.11.0

4 years ago

1.10.1

4 years ago

1.10.0

4 years ago

1.9.1

4 years ago

1.9.0

4 years ago

1.8.3

4 years ago

1.8.2

4 years ago

1.8.1

4 years ago

1.8.0

4 years ago

1.7.1

4 years ago

1.7.0

4 years ago

1.6.0

5 years ago

1.5.4

5 years ago

1.5.3

5 years ago

1.5.2

5 years ago

1.5.1

5 years ago

1.5.0

5 years ago

1.4.0

5 years ago

1.3.4

5 years ago

1.3.3

5 years ago

1.3.2

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.4

5 years ago

1.2.3

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.17

5 years ago

1.0.16

5 years ago

1.0.15

5 years ago

1.0.14

6 years ago

1.0.13

6 years ago

1.0.12

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago