On 07/03/2010 11:17 AM, Vincent Massol wrote:
> Hi Sergiu,
>
> On Jul 3, 2010, at 12:56 AM, sdumitriu (SVN) wrote:
>
>> Author: sdumitriu
>> Date: 2010-07-03 00:56:27 +0200 (Sat, 03 Jul 2010)
>> New Revision: 29950
>>
>> Modified:
>>    
>> enterprise/trunk/distribution-test/ui-tests/src/test/it/org/xwiki/it/ui/EditObjectsTest.java
>> Log:
>> [misc] New test: adding an object by clicking the inline "New<class>  object"
>
> [snip]
>
>> +
>> +    @Test
>> +    public void testInlineObjectAddButton()
>> +    {
>> +        ObjectEditPage oep = new ObjectEditPage();
>> +        oep.switchToEdit("Test", "EditObjectsTestObject");
>> +        oep.addObject("XWiki.XWikiUsers");
>> +
>> +        
>> getDriver().findElement(By.cssSelector("[id='add_xobject_XWiki.XWikiUsers'] 
>> .xobject-add-control")).click();
>> +        Wait<WebDriver>  wait = new WebDriverWait(getDriver(), 
>> getUtil().getTimeout());
>> +        wait.until(new ExpectedCondition<Boolean>()
>> +                    {
>> +            public Boolean apply(WebDriver driver)
>> +                        {
>> +                return 
>> Boolean.valueOf(driver.findElements(By.cssSelector("[id='xclass_XWiki.XWikiUsers']
>>  .xobject"))
>> +                    .size() == 2);
>> +            }
>> +        });
>
> Isn't this an api missing in Page Objects (what does it do)?

There already is an addObject API in the object editor page, but it uses 
the general drop-down list to choose an object type. This test 
explicitly tests the new inline link appearing under an existing object 
type. I know it's a lower level kind of test compared to the others, but 
I wasn't sure if it should go as another method in the page class or 
not. WDYT?

-- 
Sergiu Dumitriu
http://purl.org/net/sergiu/
_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to