为什么没有发送Key在这个Protractor脚本上工作?

时间:2015-11-01 21:42:36

标签: javascript angularjs jasmine automated-tests protractor

为什么没有发送Key在这个Protractor脚本上工作?

我在Protractor工作中几乎没有尝试做任何事情,但这似乎应该写得正确。我错过了什么?

creditCardInformation = function (ccHolderName,ccNumber,ccExpirationDate,ccCvvCode,ccBillingAddress,ccBillingCity,ccBillingState,ccBillingCountry) {  
        // ### USER-DEFINED VARIABLES - Credit Card             
        var ccHolderName = 'Johann Sebastian';
        var ccNumber = '1111222233334444';
        var ccExpirationDate = '10/2020';
        var ccCvvCode = '896';
        var ccBillingAddress = '1313 Mockingbird Lane';
        var ccBillingCity = 'Chicago';
        var ccBillingState = 'IL';
        var ccBillingCountry = 'USA';
        // ### STATIC VARIABLES - Credit Card 
        var creditCardHolderName = element(by.model('cc.cardHolderName'));
        var creditCardNumber = element(by.model('cc.creditCardNumber'));
        var creditCardExpirationDate = element(by.model('cc.expiry'));
        var creditCardCvvCode = element(by.model('cc.cvv'));
        var creditCardBillingAddress = element(by.model('cc.billingAddress'));
        var creditCardBillingCity = element(by.model('cc.billingCity'));
        var creditCardBillingState = element(by.model('cc.billingState'));
        var creditCardBillingCountry = element(by.model('cc.billingCountry'));
        // ### STATIC FUNCTIONS - Credit Card   
        creditCardHolderName.sendKeys(ccHolderName);
        creditCardNumber.sendKeys(ccNumber);
        creditCardExpirationDate.sendKeys(ccExpirationDate);
        creditCardCvvCode.sendKeys(ccCvvCode);
        creditCardBillingAddress.sendKeys(ccBillingAddress);
        creditCardBillingCity.sendKeys(ccBillingCity);
        creditCardBillingState.sendKeys(ccBillingState);
        creditCardBillingCountry.sendKeys(ccBillingCountry);      
    };

https://jsfiddle.net/quantumspooky/86k6z9pt/

1 个答案:

答案 0 :(得分:0)

感谢两个人的评价没有评论,我弄清楚我在这里做错了什么。

而不是 <receiver android:name=".MyReceiver" android:enabled="true" android:exported="true" > <intent-filter> <action android:name="android.intent.action.SEND" /> <category android:name="android.intent.category.DEFAULT" /> <data android:mimeType="text/plain" /> </intent-filter> </receiver>

我应该说creditCardInformation = function (ccHolderName,ccNumber,ccExpirationDate,ccCvvCode,ccBillingAddress,ccBillingCity‌​,ccBillingState,ccBillingCountry)