GithubHelp home page GithubHelp logo

candybean's Introduction

Candybean

Candybean is SugarCRM's next generation automation and testing framework. It is a collection of components that fosters test automation, execution configuration, data abstraction, results illustration, tag-based execution, top-down and bottom-up batches, mobile variants, plain-language testing, and web service testing.

Features

Some project features planned for Candybean:

  • HTML 5 support (Sugar 7): supports HTML 5 elements
  • Support Java-based tests/calls: executes Java-based test scripts
  • Abstraction from dependent technologies: ** Supports multiple, independent reporting options (e.g. XML, HTML) ** Supports multiple automation frameworks (de-prioritized) ** Data-driven resource agnostic (e.g. DB, XML, JSON)
  • Independent from project-specific parameters: ** Supports product objectification, thus platform-independent ** Product independent (no Sugar-specific references)
  • Self-testing: ** Verify element hooks are valid before running tests ** Verify abstract element behavior (fields, menus, etc.) ** Unit and system tested
  • Script-style logging: make debugging readable, easier
  • Failure/error non-blocking: option to continue executing tests upon error/failure
  • Resource consolidating: pre-execution resource scan for consolidated allocation
  • Supports 'smart' waits (WIP definition)
  • Configurable with ease/overridable via CLI
  • Randomized testing: Supports randomized/stress testing
  • Open-source: ** JavaDoc/API with usage details, examples, best practices ** Externally-facing site/wiki with installation documentation ** Code samples
  • Best practice, OOP-organized code for ease of maintenance
  • Easy to install (GUI installer or minimal configuration)

Components

This is a list of components that collectively fall under Candybean:

  • Automation: contains functionality that automates application interaction
  • Configuration: an extension of the native Java Properties object with configuration-file-specific functionality
  • Data Source: an abstracted data source object with iterative and key-value behavior
  • Results: an encapsulation of test result parsing and illustrative/presentation functionality
  • Runner: an annotation-based orchestration object that executes identified code portions
  • Test: a utilities package with test-specific helper functionality
  • Translations: outputs given files with translated strings; can be used for i18n, etc.
  • Utilities: contains generic helper functionality
  • Web Services: contains REST request-building and response-parsing functionality
  • Mobile: a cross platform mobile testing framework

Installation

Install and configure the following dependencies:

Configuration

The following key-value keys should be defined in a configuration file used to instantiate Candybean

automation.interface = chrome # chrome | firefox | ie | opera | android | ios  
browser.firefox_binary = {\
	"linux": "/path/to/firefox/binary/in/linux", \
	"mac": "/path/to/firefox/binary/on/mac", \
	"windows": "c:/path/to/firefox/binary/in/windows"}
browser.firefox_profile = default
browser.chrome_driver_path = {\
	"linux": "/path/to/chrome/driver/in/linux", \
	"mac": "/path/to/chrome/driver/on/mac", \
	"windows": "/path/to/chrome/driver/in/windows"}
browser.chrome_driver_log_path = /path/to/chromedriver/log
browser.ie_driver_path = /path/to/ie/driver
perf.page_load_timeout = /page/load/in/seconds
perf.implicit_wait_seconds = /passive/wait/in/seconds

Writing tests

Here's an example Java-JUnit test that instantiates Candybean and begins testing through a Chrome browser:

import com.sugarcrm.candybean;

public class CandybeanTest {

	static Candybean cb;
	
	@BeforeClass
	public static void first() throws Exception {
		Configuration candybeanConfig = new Configuration(new File("path/to/candybean.config"));
		cb = Candybean.getInstance(candybeanConfig);
		cb.getInterface().start(Type.CHROME);
	}
	
	@Test
	public void backwardForwardRefreshTest() throws Exception {
		cb.log("Bringing up craigslist.com for an apartment search!");
		cb.getInterface().go("http://www.craigslist.com/");
		assertEquals("http://www.craigslist.com/", cb.getURL());
		... do other things
		... perform other assertions
		... perform other logging
		... use other candybean features		
	}
	
	@AfterClass
	public static void last() throws Exception {
		cb.getInterface().stop();
	}
}

Executing tests

At this point, because Candybean is Maven-based, executing simple maven commands will detect written tests and execute them for test results:

> mvn clean install

You can also see the included system tests to see test examples. System tests can be executing via maven and the 'system' profile:

> mvn clean install -Psystem

Core contributors

candybean's People

Contributors

cradbold avatar raydians avatar sqwerl avatar hans-sugarcrm avatar wli-sugarcrm avatar mazen-louis avatar jdusaint avatar dsafar avatar rzhou avatar volcomism avatar sugarcrmci avatar rsennewald avatar genosis avatar swapnar avatar franklin-sugar avatar cfoxsugar avatar chant2345 avatar anisevich avatar

Stargazers

Rajkumar Singh 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.