+ Start a Discussion
Tapas TuloTapas Tulo 

Challenge Not yet complete... here's what's wrong: The unit tests in the managed package have not passed successfully. Make sure you run all test in your org before checking this section. Ensure that they all pass.

Hi All,
 Help Me out, am completely stuck here since last few days.
I have done everything perfect role, profile, Permission but not able to pass the test method.
here the screenshot.
User-added image
 
Thiruchuri AdityanThiruchuri Adityan
1. OWD settings for Opportunity object is 'Private'
2. Created public group as 'Project Managers' for Project Manager related requirements.
3. Setup Profiles and Roles for Field Sales User, Inside Sales User, and Sales Executive User
4. Created one criteria based sharing rules for Opportunity:
Criteria: (Opportunity: TypeEQUALSExisting Customer - Upgrade) AND (Opportunity: StageEQUALSClosed Won)
Shared with: Group: Project Managers
Access level: Read Only

5. Then, created another sharing rule for Opportunity (this one I created only after unsuccessful run of the test cases). This sharing rule is owner based, with the following details:
Criteria: Owner in All Internal Users
Shared with: Role: Inside Sales
Access level: Read/Write

These steps should be enough to complete the stage-2.
NagendraNagendra (Salesforce Developers) 
Hi Tapas,

As per the above screenshot seems no issue with the work done.May I suggest you please clear all the cookies and log out of your account and give a try by logging in once again which should probably resolve the issue.

Still, if the problem persists please let us know.

Regards,
Nagendra.
Derek Bennett 5Derek Bennett 5
At first I was receiving the error which said I do not have the correct opportunity sharing rules. So now that I corrected that I still cannot clear the apex test, here's my error: 

Challenge Not yet complete... here's what's wrong: 
The unit tests in the managed package have not passed successfully. Make sure you run all test in your org before checking this section. Ensure that they all pass.

I am lost as I do not understand what is failing or what type of query the system is performing. 
Syam Reddy 11Syam Reddy 11
Hello Adityan,

It worked for Me:)

Thank you Adityan, 
Dawud HaugabookDawud Haugabook
Can someone help?  I have been stuck on this for three days.  This is the current error message
I have tried everything listed on this forum and others and I still cannot get passed this step.
User-added image
kishor rudrakishor rudra
Can someone help...I have the same problem, the tests never got passed....
Clifford Ochieng 15Clifford Ochieng 15
Hi  Kishor Rudra,

Log into Salesforce Classic and try run the tests through the staps shown on the challenge. I did so and it passed. 
Asma Khabab KhanAsma Khabab Khan
hi
i am having the same error in clearing challenge 2 Challenge Not yet complete... here's what's wrong:
The unit tests in the managed package have not passed successfully. Make sure you run all test in your org before checking this section. Ensure that they all pass.

apex error
Class.sb_security.BeAwesome.createUser: line 132, column 1
Class.sb_security.BeAwesome.setup: line 124, column 1

any help??? have taken all the steps
Asma Khabab KhanAsma Khabab Khan
User-added imageUser-added image
Sven VoglerSven Vogler
I run into the same problem. Issue on my end was a mispelled role name, you need to use exactly the role names specified in the Use Case.

If you still run into the issue, my suggestion is to use the logs to get a sense where the test fails. In order to do so, you need to run the tests in the developer console and switch to the log tab. This will help you to understand where the test fails.

User-added image
Pargavi Selvaraj 7Pargavi Selvaraj 7
Hi Sven Vogler
Thank you so much. I have been stuck with this error for 2 days. I given role name as Inside sales user. Thats the reason for my error. Really thanks a lot.
Misaki KawaokaMisaki Kawaoka
Hi, I had the same problem, even though I did everything right.
So I added users such as Amit Sabnis and others.
I changed the company and my time zone to PST, and I finally passed the test!
I just wanted to share this information. Thanks.
Professor HastigProfessor Hastig
Same error here. The apex test throws this error:

Class BeAwesome
Method NamehugYourMother
Pass/Fail Fail
Error Message System.AssertException: Assertion Failed: Inside Sales users should be able to read all Opportunities but the test did not find all records. #sadtrombone: Expected: 3, Actual: 2
Stack TraceClass.sb_security.BeAwesome.hugYourMother: line 99, column 1

Challenge 2 wants this:
Create an opportunity owned by Samantha with the stage name 'Needs Analysis'. Create a Closed Won opportunity owned by Samantha, with the type of 'Existing Customer - Upgrade'.

Those 2 opportunities I created + a 3rd one after the test failed with said error message. Didn't work.

Any Ideas?


 
Professor HastigProfessor Hastig
This is my workaround: grant the inside sales user profile View All on Opportunities.
Sharath Shankar 33Sharath Shankar 33
I have tried everything - checked the Role and Profile names; assigned the right user and granted the rite permissions (view all on Opportunities); yet the Test Execution is failing.. what am i missing?
Prashant WayalPrashant Wayal
It should work with settings:
1. Set Account sharing setting to -> Public Read/Write
2. Set Opportunity sharing setting to  -. Private
3. Create 3 profiles mentioned in the requirement and provide the access
4. Create a public group with name as "Project Managers"
5. Create 3 roles with names as "Field Sales", "Inside Sales" and "Sales Executive"
6. Create a sharing rule on the opportunity as below:
  • Criteria: (Opportunity: TypeEQUALSExisting Customer - Upgrade) AND (Opportunity: StageEQUALSClosed Won)
    Shared with: Group: Project Managers
    Access level: Read Only
  • Criteria: Owner in All Internal Users
    Shared with: Role: Inside Sales
    Access level: Read/Write
7. Create a user for "Samantha Cordero" and assign profile as "Field Sales User" and role as "Field Sales"
8. Create 2 opportunity records as mentioned in the requirement and make sure the owner is "Samantha Cordero" for both opportunity records
9. Track the history for "Amount" field on the opportunity and other fields mentioned in the requirement
10. Run your test classes as from the managed package
10. Create permission set and enable the 2FA permission in it
11. Assign the permission set to the above-created user.
Abdullah WarraichAbdullah Warraich
Hi Sven Vogler
Thank you so very much.
ankur jain 94ankur jain 94
Thanks, Prashant Wayal. Changing the second sharing rule helped me to pass this challenge.
Tsao-Kun LiuTsao-Kun Liu
Hello,
Does anyone know how to make this box larger? I could not select sb_security this option. 
How to make this box larger? I could not select sb_security
Sunkari PavithraSunkari Pavithra
@Tsao-Kun Liu, Just drag corners of the box. So that you can see sb_security 
Javier FeriaJavier Feria

Hi everyone!

First of all thanks for the different tips, in the end, I kind of managed to get there.

One recommendation, not sure how useful it might be, Run the Apex with the developer console and do not use "Full Code Coverage", this allowed me to see the actual error message, instead of the query message.

From there, it was a lot easier to find out what the real problem was (in my case the Opportunity Internal OWD was set to Read/Write).

I hope this helps!