/*
 * Copyright 2016 Red Hat Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package io.apiman.test.integration.ui.support.selenide.pages.policies;

import com.codeborne.selenide.SelenideElement;
import io.apiman.test.integration.ui.support.selenide.layouts.AbstractAddPolicyPage;

import static com.codeborne.selenide.Selenide.$;

/**
 * @author opontes
 */
public class AddTransformationPolicyPage extends AbstractAddPolicyPage<AddTransformationPolicyPage>{

    public SelenideElement clientDataFormat(){
        return $("select[name=\"root[clientFormat]\"");
    }

    public SelenideElement serverDataFormat(){
        return $("select[name=\"root[serverFormat]\"");
    }

    public AddTransformationPolicyPage configure(String client, String server){
        clientDataFormat().selectOptionByValue(client);
        serverDataFormat().selectOptionByValue(server);
        return thisPageObject();
    }

    @Override
    public AddTransformationPolicyPage selectPolicyType() {
        return policyType("Transformation Policy");
    }
}

@@ -669,16 +669,23 @@
 %0Aimport 
+static 
 com.code
@@ -711,17 +711,13 @@
 nide
-Element
+.$
 ;%0A
+%0A
 impo
@@ -797,39 +797,32 @@
 cyPage;%0A%0Aimport 
-static 
 com.codeborne.se
@@ -836,18 +836,23 @@
 Selenide
-.$
+Element
 ;%0A%0A/**%0A 
@@ -1066,32 +1066,33 @@
 %5BclientFormat%5D%5C%22
+%5D
 %22);%0A    %7D%0A%0A    p
@@ -1125,32 +1125,32 @@
 erDataFormat()%7B%0A
-
         return $
@@ -1185,16 +1185,17 @@
 ormat%5D%5C%22
+%5D
 %22);%0A    

Fix invalid css selectors on AddTransformationPolicyPage - add missing ']'