The fast-food giant pilots CosMc’s and plans to open about 10,000 McDonald’s globally by 2027.