fix: generate frameByUrl from api.json (#285)
This commit is contained in:
@@ -464,12 +464,6 @@ class Method extends Element {
|
||||
private static Map<String, String[]> customSignature = new HashMap<>();
|
||||
static {
|
||||
customSignature.put("Page.setViewportSize", new String[]{"void setViewportSize(int width, int height);"});
|
||||
customSignature.put("Page.frame", new String[]{
|
||||
"Frame frameByName(String name);",
|
||||
"Frame frameByUrl(String glob);",
|
||||
"Frame frameByUrl(Pattern pattern);",
|
||||
"Frame frameByUrl(Predicate<String> predicate);",
|
||||
});
|
||||
customSignature.put("BrowserContext.cookies", new String[]{
|
||||
"default List<Cookie> cookies() { return cookies((List<String>) null); }",
|
||||
"default List<Cookie> cookies(String url) { return cookies(Arrays.asList(url)); }",
|
||||
@@ -568,6 +562,11 @@ class Method extends Element {
|
||||
returnType = new TypeRef(this, jsonElement.get("type"));
|
||||
if (jsonElement.has("args")) {
|
||||
for (JsonElement arg : jsonElement.getAsJsonArray("args")) {
|
||||
JsonObject paramObj = arg.getAsJsonObject();
|
||||
if (paramObj.get("name").getAsString().equals("options") &&
|
||||
paramObj.getAsJsonObject("type").getAsJsonArray("properties").size() == 0) {
|
||||
continue;
|
||||
}
|
||||
params.add(new Param(this, arg.getAsJsonObject()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,8 +52,6 @@ class Types {
|
||||
add("Page.exposeFunction.callback", "function", "FunctionCallback");
|
||||
|
||||
// The method has custom signatures
|
||||
add("Page.frame.frameSelector", "Object|string", "Custom", new Empty());
|
||||
add("Page.frame.options", "Object", "FrameOptions", new Empty());
|
||||
add("Page.selectOption.values", "Array<ElementHandle>|Array<Object>|Array<string>|ElementHandle|Object|null|string", "String");
|
||||
add("Page.setInputFiles.files", "Array<Object>|Array<path>|Object|path", "String");
|
||||
add("Frame.selectOption.values", "Array<ElementHandle>|Array<Object>|Array<string>|ElementHandle|Object|null|string", "String");
|
||||
|
||||
Reference in New Issue
Block a user