@@ -0,0 +1,1162 @@
+package com.vaadin.tests.layouts;%0D%0A%0D%0Aimport com.vaadin.tests.components.TestBase;%0D%0Aimport com.vaadin.ui.Button;%0D%0Aimport com.vaadin.ui.CssLayout;%0D%0Aimport com.vaadin.ui.TextField;%0D%0Aimport com.vaadin.ui.Button.ClickEvent;%0D%0Aimport com.vaadin.ui.Button.ClickListener;%0D%0A%0D%0Apublic class CssLayoutRemoveComponentWithCaption extends TestBase %7B%0D%0A%0D%0A    @Override%0D%0A    protected void setup() %7B%0D%0A        final CssLayout layout = new CssLayout();%0D%0A        final TextField tf = new TextField(%22Caption%22);%0D%0A        Button b = new Button(%22Remove field and add new%22, new ClickListener() %7B%0D%0A%0D%0A            @Override%0D%0A            public void buttonClick(ClickEvent event) %7B%0D%0A                layout.removeComponent(tf);%0D%0A                addComponent(new TextField(%22new field%22));%0D%0A%0D%0A            %7D%0D%0A%0D%0A        %7D);%0D%0A        layout.addComponent(tf);%0D%0A        layout.addComponent(b);%0D%0A%0D%0A        addComponent(layout);%0D%0A    %7D%0D%0A%0D%0A    @Override%0D%0A    protected String getDescription() %7B%0D%0A        return %22Clicking on the button should remove the text field and add a new 'new field' text field%22;%0D%0A    %7D%0D%0A%0D%0A    @Override%0D%0A    protected Integer getTicketNumber() %7B%0D%0A        return 4204;%0D%0A    %7D%0D%0A%0D%0A%7D%0D%0A

Test case for #4204