Giter VIP home page Giter VIP logo

cinnamon's Introduction

#Welcome to Cinnamon!

Cinnamon is a Force.com app that enables you to build and run Selenium tests to validate your custom UI pages with Visualforce or Javascript in your Salesforce organization.

With Cinnamon, you can

  • Create and execute Selenium Tests from within your Salesforce organization.
  • Get out-of-box integration with Sauce Labs, which provides comprehensive OS and browser coverage.
  • Connect to any of your Salesforce Developer Edition or sandbox organization via OAuth authentication.
  • Easily create PageObject classes to interact with your UI pages for your tests

Before you can use Cinnamon, you'll need to install, setup and configure Cinnamon. Please follow the instruction below to install and set up Cinnamon in your Salesforce organization.

##Install Cinnamon requires you to install the following package

##Set Up Cinnamon Follow these steps to set up Cinnamon in your organization.

  1. Select Cinnamon from App drop-down list
  2. Go to Settings tab
  3. Provide the configuration settings that are shown in the WebDriver Service Provider Settings section (for this example we are using Saucelabs)
  • Sauce Username <Your Sauce Username>
  • Sauce Access Key <Your Sauce Access Key>
  1. Go to Setup -> Security Controls -> Remote Site Settings. Click Edit link on the self remote site.
  2. Edit self setting to your instance
  • You can find your instance by checking the URL of your organization. For example, if the URL is https://na15.salesforce.com, your organization resides in the na15 instance.
  1. Click Cinnamon Settings tab and then the Connect to Your Org Under Test button
  2. Log in to Your Org Under Test and click Allow button

After authentication is completed, you'll see Cinnamon being connected to your Org Under Test

Now, you are set up and ready to run a Cinnamon test.

##Run a Cinnamon Test

  1. Go to Setup -> Develop -> Apex Classes
  2. Create the PageObject class NewAccountPageObject
  3. Create the Visualforce Page NewAccountPage
  4. Create the Test class TestNewAccount
  5. Click the Test Console tab.
  6. Select the TestNewAccount that now appears in the Test Console page, and then click the Execute Test button. The test should be executed successfully.
  7. Click the Passed link to view the test execution detail

##Log and Track Issues and Bugs Use Github Issues to log and track issues and bugs.

cinnamon's People

Contributors

jheritagesf avatar nadeemg avatar ryanlamore avatar ryojiosawa avatar yudiatsfdc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cinnamon's Issues

Triggering tests through Jenkins on a self-hosted Selenium Server leads to Exceptions

Hi,

I am able to run tests successfully through UI by clicking on "Execute Tests" in "Test Console" page. I am now trying to trigger tests through my Jenkins job, and it triggers the below error. I am able to trigger tests when the "WebDriver Service Provide" is sauceLabs.

Based on this I would imagine, I will have to make few more configuration changes, and I don't want to re-invent the wheel. Your help is appreciated. Thanks.

Mar 03, 2015 11:15:36 AM cinnamon.Ccli main
SEVERE: An unexpected error occurred. aborting test
java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to java.util.Map
at cinnamon.CinnamontTestSuite.getMapFromJson(CinnamontTestSuite.java:82)
at cinnamon.CinnamontTestSuite.run(CinnamontTestSuite.java:158)
at cinnamon.Ccli.run(Ccli.java:80)
at cinnamon.Ccli.main(Ccli.java:48)

Add the ability to abort the running test job

Cinnamon currently does not provide the ability to abort the test job that's already scheduled or running. This means, once you submit a test run, there's no other option but to wait until the job is done, which may not be ideal especially when you're running a suite of many tests. Cinnamon should at least provide the ability to cancel or abort the test job that's already running.

Package Class - StandardLayoutLocator is not visible.

I have installed 'Cinnamon' managed package version 1.1 in Salesforce and when I try to access Apex class 'StandardLayoutLocator' that lives in this Package , getting the given below error during compile time

cinnamon

Error: Compile Error: Type is not visible: standardlayoutlocator.

Also can somebody provide latest API Document, currently using given below link: http://forcedotcom.github.io/cinnamon/docs/

But this link is not having updated classes, it is missing some classes like VisualforceTag.

Visualforce Error (Too many SOQL queries) on switching to Cinnamon app

Hi,

I installed Cinnamon in our Sandbox on CS17. When I attempt to access the Cinnamon app, it crashes with the below error:

Visualforce Error

System.LimitException: Too many SOQL queries: 101
Error is in expression '{!syncTestInventory}' in component apex:page in page cinnamon:cn_testsetrunner: ()

()

screen shot 2016-06-28 at 19 18 46

Could you please help?

Thanks!

Error: no such element (cinnamon)

I have integrated cinnamon as per the document, I am getting the following error, can anyone please suggest a solution.

Error: no sub element (cinnamon)

Test never "stops" unless manually killed - On self-hosted Selenium Server

I have a self-hosted Selenium Server, and when I run my tests the "Execution Status" is always in "Running" mode, and it never goes into "Error" mode when there are any errors such as "cannot find a webelement".

Due to this my entire test suite is not executed. I will have to manually delete the "TestSuiteID" in order to re-execute the test. Is there a way to fix this ? Appreciate your help. Thanks.

This could be caused by Issue # 43 (#43), but just want to track this as a separate issue.

css name not found - Getting field from Page Layout

While writing a code in PageObject class to access a field on page layout edit UI page, I am receving an error in the test console as "css name is not found" in PageObjectClass.

//Code snippet from Page Object class
public override void initializePageObject()
{

    sName = getElement(new cinnamon.StandardLayoutLocator('#Name')); // I am facing problem in this line. I am not able to access 'Name' field (or any other field) from Page layout. But able to do similar thing for a visualforce page.
    sAudience = getElement(new cinnamon.ElementLocator('#00No00000069ep5'));
    saveBtn = getElement(new cinnamon.ElementLocator('input[name="save"]'));

}

image

Max Duration (Sauce) Error

screenshot 2014-07-03 12 27 22

Timeout was with:

Test Name TestSampleCinnamonTest TestSuite 0000
Execution Status Passed Result Passed
OS OS X 10.6 Browser firefox
Browser Version 18 Test Rerun Not Checked

No Timeout was with:

Test Name TestSampleCinnamonTest TestSuite 0001
Execution Status Passed Result Passed
OS Windows 8 Browser firefox
Browser Version 18 Test Rerun Not Checked

Support Salesforce Community/Partner Portal

Cinnamon currently does not support Salesforce Community or Partner Portal out of the box. This means, if you want to write a test for your community site, you need to write extra code to login to your site. Cinnamon should provide the ability to automatically log into your portal site just like how Cinnamon supports the regular Salesforce app.

Unable to use static variable concept

I have very well used Static in Java language. I tried implementing something similar here.
//Created a TestData class and defined a static variable with blank value
public with sharing class TestData extends cinnamon.PageObject {
public static String testvalue ='';
}

// Created first Test class and assigned value to it
public with sharing class Test1 extends cinnamon.BaseTest {
public override void test(cinnamon.Context context) {
Generic generic= (Generic) context.getPageObject(Generic.class);

       TestData.testvalue = 'SearchValue';
                   generic.typeGlobalSearch(TestData.testvalue);
                   generic.clickGlobalsearchBtn();

}
}

//Created second test class and called static variable again
public with sharing class Test2 extends cinnamon.BaseTest {
public override void test(cinnamon.Context context) {
Generic generic= (Generic) context.getPageObject(Generic.class);

                  generic.typeGlobalSearch(TestData.testvalue);
                   generic.clickGlobalsearchBtn();

}
}

My expectation was, when the first test case will execute it will assign value to static variable now when second test class using that variable it should be getting value updated by test1 class.
Test class executed in that order only test1 and then test2.
But in test2, its taking blank value only for static variable.

Please suggest where am I getting wrong.

Issue installing Cinnamon on Sandbox org

Hi,

I have installed Cinnamon on Sandbox org and the installation is successful. however when I tried opening the Cinnamon app I am getting the below error.

Error: Previous load of class failed: testDate: line 189, column 13: Variable does not exist: TimeZone

Could you please help.

Regards,
Alok

Error: For input string: "<my-saucelabs-key>@ondemand.saucelabs.com:80" (cinnamon)

Hello,

I followed the example in the setup doc and it seemed that I had no trouble getting things configured, however, when I go to execute a test using the unmodified demo code, the test failed with the following error:

For input string: "[email protected]:80"
(cinnamon)

The error message has my Saucelabs access key before the @ in the error message. It looks as though the webdriver might be trying to authenticate me and failing? I've verified that the key is correct and even tried generating a new one.

Any help would be appreciated! Thanks!

How can we access elements of salesforce1 app ?

Just went through the cinnamon demo video in youtube. Started with couple of shown examples. I must say, its a great work you've guys have done. Something new i have seen. I was wondering, it says it supports/built on salesforce one platform. I was able to successfully navigate to one app.But could not able to access elements since it din't had 'id' nor 'tag with name attribute'. Most of them are aura components. Can you help me here, if you guys have come across something like this ? And also can we schedule the test ?

Examples?

@ryojiosawa I stumbled across this and was immediately intrigued to give it a go. It seems incredibly awesome, but I have a couple questions:

  • Are there any deeper examples of cinnamon test classes beyond the main sample one (and which include Selenium commands)?
  • Related to that, what is the best way to import commands from the Seleneium IDE into an apex class?

Regression: Things that used to work on Beta are broken in Spring Manage Package 1.1

Hi,

The below code complains of "Error: Compile Error: Abstract class cannot be constructed: cinnamon.ElementLocator at line 24 column 28".

It works fine for the VisualForceLocators but not for the "ElementLocators". Are there any changes around this. I don't see any update on the Documentation though.

"public class CinnamonAccountPageObject extends cinnamon.PageObject {

 public cinnamon.ElementLocator accountTabLoc,

public override void initializePageObject() {
    accountTabLoc=new cinnamon.ElementLocator('#Account_Tab > a');"

}
}

Showing Error for getWindowHandle() and switchToWindow methods of RemoeWebDriver class

Hi,
I am trying to use method getWindowHandles() provided in RemoteWebDriver class.
public class GenericMethods extends cinnamon.PageObject {

public void switchWindow()
{
List test =getRemoteWebDriver().getWindowHandles();
getRemoteWebDriver().switchToWindow('Testing');
}
}

for this I am getting error
Error: Compile Error: Method does not exist or incorrect signature: [cinnamon.RemoteWebDriver].getWindowHandle()

Even if I comment first line of method and trying saving it I am getting error
Error: Compile Error: Method does not exist or incorrect signature: [cinnamon.RemoteWebDriver].switchToWindow(String)

So I am not able to use both the methods though they are provided in documentation I am able to use another method of same class
getRemoteWebDriver().switchToFrame(frame);

Please suggest If I am doing anything wrong or help me with work around. I am trying to automate a scenario where when I am clicking on "Activity Summary by case" button its opening up new window.

Methods details for Cinnamon classes

Hi,

I am new to Cinnamon. Is there a way we can get what all classes cinnamon supports along with supporting methods (input/ouput) for those classes.

Thanks

Cinnamon app questions

Hi,
I started work with Cinnamon and I get som equestions
1.How switch between pages in Cinnamon app(code)?
2. How use diffrenrent selectors(by xpath or by css)?
3 How use tables(ex: when lookup page is opened )
Thanks,
Ilana

Showing Error for getWindowHandle() and switchToWindow methods of RemoeWebDriver class

Hi,
I am trying to use method getWindowHandles() provided in RemoteWebDriver class.
public class HughesServiceCloud_GenericMethods extends cinnamon.PageObject {

public void switchWindow()
{
List test =getRemoteWebDriver().getWindowHandles();
getRemoteWebDriver().switchToWindow('Testing');
}
}

for this I am getting error
Error: Compile Error: Method does not exist or incorrect signature: [cinnamon.RemoteWebDriver].getWindowHandle()

Even if I comment first line of method and trying saving it I am getting error
Error: Compile Error: Method does not exist or incorrect signature: [cinnamon.RemoteWebDriver].switchToWindow(String)

So I am not able to use both the methods though they are provided in documentation I am able to use another method of same class
getRemoteWebDriver().switchToFrame(frame);

Please suggest If I am doing anything wrong or help me with work around. I am trying to automate a scenario where when I am clicking on "Activity Summary by case" button its opening up new window.

Capturing screenshots, selenium Logs on Self-Hosted Selenium Server

When I run cinnamon tests on SauceLabs,we have the default capability to display the snapshots and Selenium Logs, etc, and this is a great feature to debug.

However, when I run my cinnamon tests on self-hosted selenium server, I lose this feature.

Can you provide this capability to capture and display the snapshots, Selenium Logs taken by Selenium in Cinnamon "Test Execution" details section when we run tests on a self-hosted Selenium server? Thanks (or provide some details as to how you did it in "SaucelabsProvider.cls", so we don't have to re-invent the wheel. Thanks.

Project Plans?

I haven't seen any activity on this project for the last couple of years. The current app doesn't allow adding of Salesforce instances, so is basically useless. Any interest in making this open source?

Provide ability to specify the default OS/Browser option

Cinnamon currently does not provide the ability to specify the default OS/Browser option. This means, you need to select your OS/Browser option every time you run your tests via Test Console UI. If you can’t specify the default OS/Browser option, it should at least remember the OS/Browser option that’s used in the last test run.

Script is getting failed for Selenium.waitForPageToLoad()

As shown in example while writing PageObject class in method we are returning this object and before that using selenium.waitForPageToLoad.
public Generic clickGlobalSearchBtn() {

    if (globalSearchBtn == null) {
        globalSearchBtn = getElement(new cinnamon.ElementLocator('#phSearchButton'));
    }

    globalSearchBtn.click();
   selenium.waitForPageToLoad('5000');
     return this

We are calling this method in Test class. Many times our test case is failing with below error.
waitForPageToLoad
29.32s (+6.47s)
(5000)
=> "Timed out after 5000ms"

Some its working and some time for same step its getting failed with above error.
We need to rerun our script again and again and taking lot of effort and time in execution.

We are also using wait.until for some object existence but if page is taking time this is getting failed and we need to use waitforPageToLoad.

Can you pls suggest where we are getting wrong or if there is any workaround.

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.