com.alibaba.weex.WXPageActivity Java Examples

The following examples show how to use com.alibaba.weex.WXPageActivity. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: WeexUiTestCaseTcElementOpt.java    From WeexOne with MIT License 6 votes vote down vote up
public void setUp() throws Exception{

        Log.e("TestScript_Guide", "setUp  test!!");
        setActivityInitialTouchMode(false);
        weappApplication = new WeappJsBaseTestCase();
        mInstrumentation = getInstrumentation();

        Intent intent = new Intent();
        intent.putExtra("bundleUrl", Constants.BUNDLE_URL);
        launchActivityWithIntent("com.alibaba.weex", WXPageActivity.class, intent);
        waTestPageActivity = getActivity();
//        waTestPageActivity.getIntent().getData().toString();
        Log.e(TAG,"activity1=" + waTestPageActivity.toString() );
        Thread.sleep(3000);

        mViewGroup = (ViewGroup) waTestPageActivity.findViewById(R.id.container);
        setViewGroup(mViewGroup);

        mCaseListIndexView = ViewUtil.findViewWithText(mViewGroup, "TC_");
        Thread.sleep(3000);
    }
 
Example #2
Source File: WeexUiTestCaseTcDowngradeOSVFalse.java    From weex with Apache License 2.0 6 votes vote down vote up
public void setUp() throws Exception{

        Log.e("TestScript_Guide", "setUp  into!!");
        setActivityInitialTouchMode(false);
        mInstrumentation = getInstrumentation();

        Intent intent = new Intent();
        intent.putExtra("bundleUrl", Constants.BUNDLE_URL);
        launchActivityWithIntent("com.alibaba.weex", WXPageActivity.class, intent);
        setActivity(WXPageActivity.wxPageActivityInstance);
        waTestPageActivity = getActivity();
//        waTestPageActivity.getIntent().getData().toString();
        Log.e(TAG,"activity1=" + waTestPageActivity.toString() );
        sleep(3000);

        mViewGroup = (ViewGroup) waTestPageActivity.findViewById(R.id.container);
        mCaseListIndexView = ViewUtil.findViewWithText(mViewGroup, "TC_");
    }
 
Example #3
Source File: WeexUiTestCaseTcDowngradeAppVFalse.java    From WeexOne with MIT License 6 votes vote down vote up
public void setUp() throws Exception{

        Log.e("TestScript_Guide", "setUp  into!!");
        setActivityInitialTouchMode(false);
        mInstrumentation = getInstrumentation();

        Intent intent = new Intent();
        intent.putExtra("bundleUrl", Constants.BUNDLE_URL);
        launchActivityWithIntent("com.alibaba.weex", WXPageActivity.class, intent);
        setActivity(WXPageActivity.wxPageActivityInstance);
        waTestPageActivity = getActivity();
//        waTestPageActivity.getIntent().getData().toString();
        Log.e(TAG,"activity1=" + waTestPageActivity.toString() );
        sleep(3000);

        mViewGroup = (ViewGroup) waTestPageActivity.findViewById(R.id.container);
        mCaseListIndexView = ViewUtil.findViewWithText(mViewGroup, "TC_");
        Thread.sleep(3000);

    }
 
Example #4
Source File: WeexUiTestCaseTcElementOpt.java    From weex with Apache License 2.0 6 votes vote down vote up
public void setUp() throws Exception{

        Log.e("TestScript_Guide", "setUp  test!!");
        setActivityInitialTouchMode(false);
        weappApplication = new WeappJsBaseTestCase();
        mInstrumentation = getInstrumentation();

        Intent intent = new Intent();
        intent.putExtra("bundleUrl", Constants.BUNDLE_URL);
        launchActivityWithIntent("com.alibaba.weex", WXPageActivity.class, intent);
        waTestPageActivity = getActivity();
//        waTestPageActivity.getIntent().getData().toString();
        Log.e(TAG,"activity1=" + waTestPageActivity.toString() );
        Thread.sleep(3000);

        mViewGroup = (ViewGroup) waTestPageActivity.findViewById(R.id.container);
        setViewGroup(mViewGroup);

mCaseListIndexView = ViewUtil.findViewWithText(mViewGroup, "TC_");        Thread.sleep(1000);
    }
 
Example #5
Source File: WeexUiTestCaseTcImageUpdate.java    From weex with Apache License 2.0 6 votes vote down vote up
public void setUp() throws Exception{

        Log.e("TestScript_Guide", "setUp  into!!");
        setActivityInitialTouchMode(false);
        mInstrumentation = getInstrumentation();

        Intent intent = new Intent();
        intent.putExtra("bundleUrl", Constants.BUNDLE_URL);
        launchActivityWithIntent("com.alibaba.weex", WXPageActivity.class, intent);
        setActivity(WXPageActivity.wxPageActivityInstance);
        waTestPageActivity = getActivity();
//        waTestPageActivity.getIntent().getData().toString();
        Log.e(TAG,"activity1=" + waTestPageActivity.toString() );
        sleep(3000);

        mViewGroup = (ViewGroup) waTestPageActivity.findViewById(R.id.container);
        mCaseListIndexView = ViewUtil.findViewWithText(mViewGroup, "TC_");
    }
 
Example #6
Source File: WeexPerTestCaseListPerfWithAppendTree.java    From WeexOne with MIT License 6 votes vote down vote up
public void setUp() throws Exception{

        Log.e("TestScript_Guide", "setUp  test!!");
        setActivityInitialTouchMode(false);
        weappApplication = new WeappJsBaseTestCase();
        mInstrumentation = getInstrumentation();

        Intent intent = new Intent();
        intent.putExtra("bundleUrl", Constants.BUNDLE_URL);
        launchActivityWithIntent("com.alibaba.weex", WXPageActivity.class, intent);
        waTestPageActivity = getActivity();
//        waTestPageActivity.getIntent().getData().toString();
        Log.e(TAG,"activity1=" + waTestPageActivity.toString() );
        Thread.sleep(3000);

        mViewGroup = (ViewGroup) waTestPageActivity.findViewById(R.id.container);
        setViewGroup(mViewGroup);

        mCaseListIndexView = ViewUtil.findViewWithText(mViewGroup, "TC_");
        sleep(3000);
    }
 
Example #7
Source File: WeexUiTestCaseTcDowngradeWeexVFalse.java    From weex with Apache License 2.0 6 votes vote down vote up
public void setUp() throws Exception{

        Log.e("TestScript_Guide", "setUp  into!!");
        setActivityInitialTouchMode(false);
        mInstrumentation = getInstrumentation();

        Intent intent = new Intent();
        intent.putExtra("bundleUrl", Constants.BUNDLE_URL);
        launchActivityWithIntent("com.alibaba.weex", WXPageActivity.class, intent);
        setActivity(WXPageActivity.wxPageActivityInstance);
        waTestPageActivity = getActivity();
//        waTestPageActivity.getIntent().getData().toString();
        Log.e(TAG,"activity1=" + waTestPageActivity.toString() );
        sleep(3000);

        mViewGroup = (ViewGroup) waTestPageActivity.findViewById(R.id.container);
        mCaseListIndexView = ViewUtil.findViewWithText(mViewGroup, "TC_");
    }
 
Example #8
Source File: WeexUiTestCaseTcTextStyleRow.java    From weex with Apache License 2.0 6 votes vote down vote up
public void setUp() throws Exception{

        Log.e("TestScript_Guide", "setUp  test!!");
        setActivityInitialTouchMode(false);
        weappApplication = new WeappJsBaseTestCase();
        mInstrumentation = getInstrumentation();

        Intent intent = new Intent();
        intent.putExtra("bundleUrl", Constants.BUNDLE_URL);
        launchActivityWithIntent("com.alibaba.weex", WXPageActivity.class, intent);
        waTestPageActivity = getActivity();
//        waTestPageActivity.getIntent().getData().toString();
        Log.e(TAG,"activity1=" + waTestPageActivity.toString() );
        Thread.sleep(3000);

        mViewGroup = (ViewGroup) waTestPageActivity.findViewById(R.id.container);
        setViewGroup(mViewGroup);
        TouchUtils.scrollToBottom(this, waTestPageActivity, mViewGroup);


        mCaseListIndexView = ViewUtil.findViewWithText(mViewGroup, "TC_");        Thread.sleep(3000);
    }
 
Example #9
Source File: WeexUiTestCaseTcDowngradeWeexVTrue.java    From WeexOne with MIT License 6 votes vote down vote up
public void setUp() throws Exception{

        Log.e("TestScript_Guide", "setUp  into!!");
        setActivityInitialTouchMode(false);
        mInstrumentation = getInstrumentation();

        Intent intent = new Intent();
        intent.putExtra("bundleUrl", Constants.BUNDLE_URL);
        launchActivityWithIntent("com.alibaba.weex", WXPageActivity.class, intent);
        setActivity(WXPageActivity.wxPageActivityInstance);
        waTestPageActivity = getActivity();
//        waTestPageActivity.getIntent().getData().toString();
        Log.e(TAG,"activity1=" + waTestPageActivity.toString() );
        sleep(3000);

        mViewGroup = (ViewGroup) waTestPageActivity.findViewById(R.id.container);
        mCaseListIndexView = ViewUtil.findViewWithText(mViewGroup, "TC_");
        Thread.sleep(3000);

    }
 
Example #10
Source File: TestFlow.java    From WeexOne with MIT License 5 votes vote down vote up
private void doClickAction(String action, String actionValue){
    setActivity(WXPageActivity.wxPageActivityInstance);
    activity2 = getActivity();
    Log.e(TAG, "activity2 = " + activity2.toString());

    ViewGroup myGroup = (ViewGroup) (activity2.findViewById(R.id.container));
    ArrayList<View> inputListView11 = new ArrayList<View>();
    sleep(3000);

    inputListView11 = ViewUtil.getAllChildViews(myGroup);

    for (View view : inputListView11) {
        if (view instanceof WXTextView) {
            if (((WXTextView) view).getText().toString().contains((String)actionValue)) {
                final FrameLayout aView = (FrameLayout) view.getParent();
                mInstrumentation.runOnMainSync(new Runnable() {
                    @Override
                    public void run() {
                        aView.requestFocus();
                        aView.performClick();
                        Log.e(TAG,  "do click ");

                    }
                });

                break;
            }
        }

    }
}
 
Example #11
Source File: WeexUiTestCaseTcImageUpdate.java    From weex with Apache License 2.0 5 votes vote down vote up
/**
 * snapshot
 */
public void screenShot(String shotName) {
    try {
        ScreenShot.shoot(WXPageActivity.wxPageActivityInstance, shotName);
    } catch (IOException e) {
        e.printStackTrace();
    }
}
 
Example #12
Source File: WeexUiTestCaseTcTextStyleColumn.java    From WeexOne with MIT License 5 votes vote down vote up
/**
 * snapshot
 */
public void screenShot(String shotName) {
    try {
        ScreenShot.shoot(WXPageActivity.wxPageActivityInstance, shotName);
    } catch (IOException e) {
        e.printStackTrace();
    }
}
 
Example #13
Source File: WeexUiTestCaseTCAHrefStyle.java    From WeexOne with MIT License 5 votes vote down vote up
/**
 * snapshot
 */
public void screenShot(String shotName) {
    try {
        ScreenShot.shoot(WXPageActivity.wxPageActivityInstance, shotName);
    } catch (IOException e) {
        e.printStackTrace();
    }
}
 
Example #14
Source File: WeexUiTestCaseTcTextType.java    From WeexOne with MIT License 5 votes vote down vote up
/**
 * snapshot
 */
public void screenShot(String shotName) {
    try {
        ScreenShot.shoot(WXPageActivity.wxPageActivityInstance, shotName);
    } catch (IOException e) {
        e.printStackTrace();
    }
}
 
Example #15
Source File: WeexPerTestCaseListPerfWithAppendTree.java    From weex with Apache License 2.0 5 votes vote down vote up
/**
 * snapshot
 */
public void screenShot(String shotName) {
    try {
        ScreenShot.shoot(WXPageActivity.wxPageActivityInstance, shotName);
    } catch (IOException e) {
        e.printStackTrace();
    }
    sleep(3000);

}
 
Example #16
Source File: WeexUiTestCaseTcInputStyle.java    From weex with Apache License 2.0 5 votes vote down vote up
/**
 * snapshot
 */
public void screenShot(String shotName) {
    try {
        ScreenShot.shoot(WXPageActivity.wxPageActivityInstance, shotName);
    } catch (IOException e) {
        e.printStackTrace();
    }
}
 
Example #17
Source File: AG_Border_Div_Border_Bottom_Width.java    From WeexOne with MIT License 4 votes vote down vote up
public AG_Border_Div_Border_Bottom_Width() {
	super(WXPageActivity.class);
}
 
Example #18
Source File: AG_Border_Div_Border_Bottom_Color.java    From WeexOne with MIT License 4 votes vote down vote up
public AG_Border_Div_Border_Bottom_Color() {
	super(WXPageActivity.class);
}
 
Example #19
Source File: AG_Border_Text_Border_Color.java    From WeexOne with MIT License 4 votes vote down vote up
public AG_Border_Text_Border_Color() {
	super(WXPageActivity.class);
}
 
Example #20
Source File: AG_Text_Text_Font_Size.java    From WeexOne with MIT License 4 votes vote down vote up
public AG_Text_Text_Font_Size() {
	super(WXPageActivity.class);
}
 
Example #21
Source File: WeexUiTestCaseTcColorUpdate.java    From WeexOne with MIT License 4 votes vote down vote up
public void testColorUpdateType(){

        for(final View caseView : mCaseListIndexView){
           if (((WXTextView)caseView).getText().toString().equals("TC_Color")){
               Log.e(TAG, "TC_Color find");

               final WXTextView inputView  = (WXTextView)caseView;
                mInstrumentation.runOnMainSync(new Runnable() {
                    @Override
                    public void run() {
                        inputView.requestFocus();
                        inputView.performClick();
                    }
                });

               sleep(2000);

               setActivity(WXPageActivity.wxPageActivityInstance);
               Activity activity2 = getActivity();
               Log.e(TAG, "activity2 = " + activity2.toString());

               ViewGroup myGroup = (ViewGroup)(activity2.findViewById(R.id.container));
               Log.e(TAG, myGroup.toString());

               ArrayList<View> inputListView = new ArrayList<View>();
//               myGroup.findViewsWithText(inputListView, "TC_Color_Update", View.FIND_VIEWS_WITH_TEXT);
               inputListView =  ViewUtil.findViewWithText(myGroup, "TC_Color_Update");

               Log.e(TAG, "TC_Color_Update size== " + inputListView.size());
               sleep(2000);

               if(inputListView.size()!=0){
                  final WXTextView inputTypeView = (WXTextView)inputListView.get(0);

                   mInstrumentation.runOnMainSync(new Runnable() {
                       @Override
                       public void run() {
                           inputTypeView.requestFocus();
                           inputTypeView.performClick();
                           Log.e(TAG, "TC_Color_Type clcik!");
                       }
                   });

                   sleep(2000);

                   setActivity(WXPageActivity.wxPageActivityInstance);
                   ViewUtil viewContor = new ViewUtil();

                   sleep(1000);
                   Log.e(TAG, "TC_Color_Update_01_beforeClick snap!");
                   screenShot("TC_Color_Update_01_beforeClick");

                   // 开始点击

                    ViewGroup vg = (ViewGroup)getActivity().findViewById(R.id.container);
                    List<View> vgChildView  = viewContor.getAllChildViews(vg);
                   Log.e(TAG, vgChildView.size() + "  vgChildView do performClick !");
                   for(final View child : vgChildView){

                       mInstrumentation.runOnMainSync(new Runnable() {
                           @Override
                           public void run() {
                               child.requestFocus();
                               child.performClick();
                               Log.e(TAG, child.getClass().toString() + " do performClick !");
                           }
                       });

                       sleep(1000);
                   }
                   Log.e(TAG, "TC_Color_Update_02_afterClick snap!");
                   screenShot("TC_Color_Update_02_afterClick");

               }
           }
        }

    }
 
Example #22
Source File: AG_Border_Image_Border_Bottom_Color.java    From WeexOne with MIT License 4 votes vote down vote up
public AG_Border_Image_Border_Bottom_Color() {
	super(WXPageActivity.class);
}
 
Example #23
Source File: WeexPerTestCaseListPerfWithAppendTree.java    From weex with Apache License 2.0 4 votes vote down vote up
public void testPerfMonitorListAppendTree(){

        for(final View caseView : mCaseListIndexView){
           if (((WXTextView)caseView).getText().toString().equals("TC_Monitor")){
               Log.e(TAG, "TC_Monitor find");

               final WXTextView inputView  = (WXTextView)caseView;
                mInstrumentation.runOnMainSync(new Runnable() {
                    @Override
                    public void run() {
                        inputView.requestFocus();
                        inputView.performClick();
                        Log.e(TAG, "TC_Monitor click!!");
                    }
                });

               sleep(2000);

               setActivity(WXPageActivity.wxPageActivityInstance);
               Activity activity2 = getActivity();
               Log.e(TAG, "activity2 = " + activity2.toString());

               ViewGroup myGroup = (ViewGroup)(activity2.findViewById(R.id.container));
               Log.e(TAG, myGroup.toString());

               ArrayList<View> inputListView = new ArrayList<View>();
               inputListView = ViewUtil.findViewWithText(myGroup, "TC_Monitor_List_WithAppendTree");
//               myGroup.findViewsWithText(inputListView, "TC_Monitor_List_WithAppendTree", View.FIND_VIEWS_WITH_TEXT);

               Log.e(TAG, "TC_Monitor_List_WithAppendTree size== " + inputListView.size());

               if(inputListView.size()!=0){
                  final WXTextView inputTypeView = (WXTextView)inputListView.get(0);

                   mInstrumentation.runOnMainSync(new Runnable() {
                       @Override
                       public void run() {
                           inputTypeView.requestFocus();
                           inputTypeView.performClick();
                           Log.e(TAG, "TC_Monitor_List_WithAppendTree clcik!");
//                           screenShot("TC_Input_Type");
                       }
                   });


                   sleep(3000);
                   Log.e(TAG, "TC_Monitor_List_WithAppendTree snap!");
                   screenShot("TC_Monitor_List_WithAppendTree");
               }
           }
        }

    }
 
Example #24
Source File: AG_Border_A_Border_Color.java    From WeexOne with MIT License 4 votes vote down vote up
public AG_Border_A_Border_Color() {
	super(WXPageActivity.class);
}
 
Example #25
Source File: AG_Input_Input_Text_Align.java    From WeexOne with MIT License 4 votes vote down vote up
public AG_Input_Input_Text_Align() {
	super(WXPageActivity.class);
}
 
Example #26
Source File: WeexUiTestCaseTcInputPlaceholder.java    From weex with Apache License 2.0 4 votes vote down vote up
public void testInputPlaceholder(){

        for(final View caseView : mCaseListIndexView){
           if (((WXTextView)caseView).getText().toString().equals("TC_Input")){
               Log.e(TAG, "TC_Input find");

               final WXTextView inputView  = (WXTextView)caseView;
                mInstrumentation.runOnMainSync(new Runnable() {
                    @Override
                    public void run() {
                        inputView.requestFocus();
                        inputView.performClick();
                    }
                });

               sleep(2000);

               setActivity(WXPageActivity.wxPageActivityInstance);
               Activity activity2 = getActivity();
               Log.e(TAG, "activity2 = " + activity2.toString());

               ViewGroup myGroup = (ViewGroup)(activity2.findViewById(R.id.container));
               Log.e(TAG, myGroup.toString());

               ArrayList<View> inputListView = new ArrayList<View>();
               inputListView = ViewUtil.findViewWithText(myGroup, "TC_Input_Placeholder");

//               myGroup.findViewsWithText(inputListView, "TC_Input_Placeholder", View.FIND_VIEWS_WITH_TEXT);

               Log.e(TAG, "TC_Input_Placeholder size== " + inputListView.size());

               if(inputListView.size()!=0){
                  final WXTextView inputTypeView = (WXTextView)inputListView.get(0);

                   mInstrumentation.runOnMainSync(new Runnable() {
                       @Override
                       public void run() {
                           inputTypeView.requestFocus();
                           inputTypeView.performClick();
                           Log.e(TAG, "TC_Input_Placeholder clcik!");


//                           screenShot("TC_Input_Type");
                       }
                   });


                   sleep(3000);
                   Log.e(TAG, "TC_Input_Placeholder snap!");
                   screenShot("TC_Input_Placeholder");

               }
           }
        }

    }
 
Example #27
Source File: AG_Border_Video_Border_Bottom_Color.java    From WeexOne with MIT License 4 votes vote down vote up
public AG_Border_Video_Border_Bottom_Color() {
	super(WXPageActivity.class);
}
 
Example #28
Source File: AG_CommonEvent_Web_Onclick.java    From WeexOne with MIT License 4 votes vote down vote up
public AG_CommonEvent_Web_Onclick() {
	super(WXPageActivity.class);
}
 
Example #29
Source File: AG_Border_Switch_Border_Style.java    From WeexOne with MIT License 4 votes vote down vote up
public AG_Border_Switch_Border_Style() {
	super(WXPageActivity.class);
}
 
Example #30
Source File: AG_Margin_Switch_Margin_Bottom.java    From WeexOne with MIT License 4 votes vote down vote up
public AG_Margin_Switch_Margin_Bottom() {
	super(WXPageActivity.class);
}