File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed
AngleSharp.Scripting.JavaScript.Tests Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change 83
83
<Compile Include =" InteractionTests.cs" />
84
84
<Compile Include =" JqueryTests.cs" />
85
85
<Compile Include =" Mocks\DelayedRequester.cs" />
86
+ <Compile Include =" PageTests.cs" />
86
87
<Compile Include =" Properties\AssemblyInfo.cs" />
87
88
<Compile Include =" ScriptEvalTests.cs" />
88
89
<Compile Include =" ScriptingTests.cs" />
Original file line number Diff line number Diff line change
1
+ namespace AngleSharp . Scripting . JavaScript . Tests
2
+ {
3
+ using NUnit . Framework ;
4
+ using System . Threading . Tasks ;
5
+
6
+ [ TestFixture ]
7
+ public class PageTests
8
+ {
9
+ //[Test]
10
+ public async Task RunHtml5Test ( )
11
+ {
12
+ var target = "http://html5test.com" ;
13
+ var config = Configuration . Default . WithJavaScript ( ) . WithCss ( ) . WithDefaultLoader ( setup => setup . IsResourceLoadingEnabled = true ) ;
14
+ var context = BrowsingContext . New ( config ) ;
15
+ var document = await context . OpenAsync ( target ) ;
16
+ var points = document . QuerySelector ( "#score > .pointsPanel > h2 > strong" ) . TextContent ;
17
+ Assert . AreNotEqual ( "0" , points ) ;
18
+ }
19
+
20
+ //[Test]
21
+ public async Task RunTaobao ( )
22
+ {
23
+ var target = "https://meadjohnson.world.tmall.com/search.htm?search=y&orderType=defaultSort&scene=taobao_shop" ;
24
+ var config = Configuration . Default . WithJavaScript ( ) . WithCss ( ) . WithDefaultLoader ( setup => setup . IsResourceLoadingEnabled = true ) ;
25
+ var context = BrowsingContext . New ( config ) ;
26
+ var document = await context . OpenAsync ( target ) ;
27
+ var prices = document . QuerySelectorAll ( "span.c-price" ) ;
28
+ Assert . AreNotEqual ( 0 , prices . Length ) ;
29
+ }
30
+ }
31
+ }
You can’t perform that action at this time.
0 commit comments