Skip to content

1.32 dev #49

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 52 commits into
base: 1.25
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
bf33f28
driver
octaltree Jul 30, 2022
3f9f201
api.json 1.25
octaltree Jul 30, 2022
04e3ea8
find commit
octaltree Jul 31, 2022
6613826
channels
octaltree Jul 31, 2022
e7e3066
protocol.yml
octaltree Jul 31, 2022
be65435
tmp
octaltree Jul 31, 2022
cdfd728
tmp
octaltree Jul 31, 2022
55ce61b
parse api.json
octaltree Aug 2, 2022
d1403bd
todo
octaltree Aug 2, 2022
b7c14a0
parse protocol.yml
octaltree Aug 2, 2022
bc47322
all_types
octaltree Aug 2, 2022
7dd0f9a
fix
octaltree Aug 2, 2022
f816f42
collect_unnamed
octaltree Aug 3, 2022
688b805
tmp
octaltree Aug 3, 2022
9785288
tmp
octaltree Aug 3, 2022
3110961
tmp
octaltree Aug 7, 2022
9815a9b
fix
octaltree Aug 7, 2022
191a83f
tmp
octaltree Aug 7, 2022
235e21c
tmp
octaltree Aug 8, 2022
6d37aee
tmp
octaltree Aug 10, 2022
7deba2f
tmp
octaltree Aug 11, 2022
c0dc4b1
generate_protocol
octaltree Aug 13, 2022
f94daf8
fix
octaltree Aug 13, 2022
c567bb2
add generated protocol
octaltree Aug 13, 2022
30d661d
borrow
octaltree Aug 14, 2022
821b239
handle messages before shutdown
octaltree Aug 14, 2022
cb3f67d
initializer based on protocol
octaltree Aug 14, 2022
2a925fb
initialization success
octaltree Aug 14, 2022
ac86372
tmp
octaltree Aug 15, 2022
13aa2ea
tmp
octaltree Aug 20, 2022
4a72d5a
Added `commit` Document state
Aug 19, 2022
e7a8ada
Using LifecycleEvent
Aug 19, 2022
a81c7a1
Using LifecycleEvent
Aug 20, 2022
8088b0d
playwright can return response without any `params` which would break…
Aug 21, 2022
82c59b9
Fixed Page Events not detected correctly
Aug 23, 2022
7768d0b
Merge pull request #35 from tmahmood/dev
octaltree Aug 25, 2022
3960388
tmp
octaltree Aug 28, 2022
48b9788
Update utils.rs
tmahmood Aug 31, 2022
e934041
Added mime_type to File structure.
Sep 3, 2022
c7210d8
Large file upload api is now implemented. It does not replace the exi…
Sep 5, 2022
a4c4073
Fixed issue with not being able to spawn multiple playwright instances.
Sep 11, 2022
153494f
Fixed issue with not being able to spawn multiple playwright instances.
Sep 11, 2022
9e97665
Merge branch '1.25' into dev
Oct 14, 2022
cdeabd2
Updated ConsoleMessage Structure to match with latest playwright version
tmahmood Apr 19, 2023
cde0f1c
Incorporated Randall's Windows Related Changes
tmahmood Apr 19, 2023
8e5e8d6
Update playwright version to: 1.31.0-alpha-feb-1-2023
Oct 14, 2022
d4cd5ea
Fixed: When using `persistent_context_launcher` `set_input_file_paths…
tmahmood Mar 14, 2023
27e1401
Incorporated Randall's Windows bug fix
tmahmood Apr 8, 2023
03d2970
Updated ConsoleMessage Structure to match with latest playwright version
tmahmood Apr 18, 2023
836ddbc
Updated connection.rs to fix parking_lot related issue
tmahmood Apr 19, 2023
9425bc3
Update github action, using nightly
tmahmood May 1, 2023
c7e8ee8
Removed a println!
tmahmood May 12, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Install latest nightly
uses: actions-rs/toolchain@v1
with:
toolchain: stable
toolchain: nightly
override: true
components: rustfmt, clippy

Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@ target
Cargo.lock
driver
tarpaulin-report.html
/.idea/
/playwright-rust-randall.iml
/scripts/scripts.iml
/src/api/generated.rs
13 changes: 7 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ documentation = "https://docs.rs/playwright/"
repository = "https://github.com/octaltree/playwright-rust"
categories = ["web-programming"]
keywords = ["testing", "headless", "web", "browser", "automation"]
edition = "2018"
edition = "2021"
build = "src/build.rs"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand All @@ -20,23 +20,24 @@ reqwest = { version = "0.11.4", features = ["blocking"] }
log = "0.4.14"
serde = { version = "1.0.126", features = ["derive"] }
serde_json = "1.0.66"
zip = "0.5.13"
zip = "0.6.4"
thiserror = "1.0.26"
strong = { version = "0.3.4", features = ["serde", "shorthand"] }
tokio = { version = "1.9.0", features = ["sync", "rt-multi-thread", "macros"] }
actix-rt = { version = "2.2.0", optional = true }
async-std = { version = "1.9.0", features = ["attributes"], optional = true }
dirs = "3.0.2"
dirs = "5.0.0"
paste = "1.0.5"
base64 = "0.13.0"
base64 = "0.21.0"
itertools = "0.10.1"
chrono = { version = "0.4.19", optional = true, features = ["serde"] }
tokio-stream = { version = "0.1.7", features = ["sync"] }
futures = "0.3.16"
serde_with = { version = "1.9.4", default-features = false, features = ["macros"] }
serde_with = { version = "2.3.2", default-features = false, features = ["macros"] }
parking_lot = "0.12.1"

[dev-dependencies]
env_logger = "0.9.0"
env_logger = "0.10.0"
tempdir = "0.3.7"
tide = "0.16.0"
warp = "0.3.1"
Expand Down
18 changes: 17 additions & 1 deletion scripts/src/api.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pub mod types;

use serde::{Deserialize, Serialize};
use serde::{Deserialize, Deserializer, Serialize};

#[derive(Debug, Deserialize)]
#[serde(transparent)]
Expand Down Expand Up @@ -35,12 +35,26 @@ pub struct Member {
pub ty: Type,
// langs
// paramOrOption null
#[serde(default)]
#[serde(deserialize_with = "string_as_bool")]
pub deprecated: bool,
//#[serde(default)]
// pub comment: String,
pub spec: Vec<SpecNode>
}

fn string_as_bool<'de, D>(deserializer: D) -> Result<bool, D::Error>
where
D: Deserializer<'de>,
{
let s = <String as Deserialize>::deserialize(deserializer);
Ok(match s {
Err(_) => false,
_ => true
})
}


#[derive(Debug, Deserialize, PartialEq, Eq, Clone, Copy)]
#[serde(rename_all = "camelCase")]
pub enum Kind {
Expand Down Expand Up @@ -79,6 +93,8 @@ pub struct Arg {
#[serde(default)]
pub spec: Vec<SpecNode>,
pub required: bool,
#[serde(default)]
#[serde(deserialize_with = "string_as_bool")]
pub deprecated: bool,
#[serde(rename = "async")]
pub is_async: bool
Expand Down
14 changes: 8 additions & 6 deletions scripts/src/api/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,15 +341,17 @@ fn declare_ty<'a>(scope: Vec<&'a str>, ty: &'a Type, allow_borrow: bool) -> Rc<M
Rc::new(Model::Vec(declare_ty(scope, t, allow_borrow)))
}
(true, false) => {
let option = ty.expression.as_deref();
assert!(
ty.expression.as_deref()
option
== Some("[IReadOnlyDictionary<string, BrowserNewContextOptions>]")
|| ty.expression.as_deref() == Some("[Map]<[string], [JSHandle]>")
|| ty.expression.as_deref() == Some("[Object]<[string], [string]>")
|| ty.expression.as_deref()
|| option == Some("[Map]<[string], [JSHandle]>")
|| option == Some("[Map<string, Object>]")
|| option == Some("[Object]<[string], [string]>")
|| option
== Some("[Object]<[string], [string]|[float]|[boolean]>")
|| ty.expression.as_deref() == Some("[Object]<[string], [Serializable]>")
|| ty.expression.as_deref() == Some("[Object]<[string], [any]>"),
|| option == Some("[Object]<[string], [Serializable]>")
|| option == Some("[Object]<[string], [any]>"),
"{:?}",
&ty
);
Expand Down
33 changes: 18 additions & 15 deletions scripts/src/generate_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,21 +143,24 @@ fn format_use_ty(x: &types::Model) -> TokenStream {
let z = format_use_ty(z);
quote!(HashMap<#y, #z>)
}
Model::Known { name, .. } => match name.as_ref() {
"binary" if reference => quote!(&'a [u8]),
"binary" => quote!(Vec<u8>),
"json" if reference => quote!(&'a str),
"json" => quote!(String),
"string" if reference => quote!(&'a str),
"string" => quote!(String),
"number" => quote!(serde_json::Number),
"float" => quote!(f64),
"boolean" => quote!(bool),
"void" => quote!(()),
_ => {
let n = format_ident!("{}", name);
assert!(!reference);
quote!(#n)
Model::Known { name, .. } => {
match name.as_ref() {
"binary" if reference => quote!(&'a [u8]),
"binary" => quote!(Vec<u8>),
"json" if reference => quote!(&'a str),
"json" => quote!(String),
"string" if reference => quote!(&'a str),
"string" => quote!(String),
"number" => quote!(serde_json::Number),
"float" => quote!(f64),
"boolean" => quote!(bool),
"void" => quote!(()),
"JsonElement?" => quote!(()),
_ => {
let n = format_ident!("{}", name);
assert!(!reference);
quote!(#n)
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/src/generate_protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ fn enum_tokens(name: &str, x: &Enum) -> TokenStream {
.collect::<Vec<_>>();
let name = format_ident!("{}", name);
quote! {
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone)]
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone, Hash)]
pub enum #name {
#(#variants),*
}
Expand Down
Loading