Git Product home page Git Product 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.

Javadoc API Documentation

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. By default, Candybean will look for a candybean.config file located in the 'config' directory

#specifies the type of autmation interface
automation.interface = chrome # chrome | firefox | ie | opera | android | ios  

#browser specific profiles and driver paths
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

#candybean logger configuration
handlers = java.util.logging.FileHandler, java.util.logging.ConsoleHandler

#file logging
java.util.logging.FileHandler.limit = 50000
java.util.logging.FileHandler.count = 1
java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter
java.util.logging.FileHandler.level = INFO

#logging format
java.util.logging.SimpleFormatter.format = [%1$tm-%1$td-%1$tY %1$tk:%1$tM:%1$tS:%1$tL] %2$s %4$s: %5$s %6$s %n

Writing tests

Here's an example Java-JUnit test that extends AbstractTest (which instantiates a candybean interface from the configuration file) and begins testing through the interface defined in the configuration.

import com.sugarcrm.candybean;
import org.junit.AfterClass;
import org.junit.Test;
import com.sugarcrm.candybean.test.AbstractTest;

public class CandybeanTest extends AbstractTest{
	
	@Test
	public void backwardForwardRefreshTest() throws Exception {
		logger.log("Bringing up craigslist.com for an apartment search!");
		candybean.getInterface().start();
		candybean.getInterface().go("http://www.craigslist.com/");
		assertEquals("http://www.craigslist.org/about/sites", cb.getURL());
		... do other things
		... perform other assertions
		... perform other logging
		... use other candybean features		
	}
	
	@AfterClass
	public static void last() throws Exception {
		candybean.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

Watchers

 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.